Giter Club home page Giter Club logo

tinycal's Introduction

tinycal.js - a lightweight JavaScript datepicker

tinycal.js is a date picker which is easy to use yet highly flexible. Weighing in under 3kb minified and requiring no external dependencies it's a good choice for developers looking to use date handling in their web applications. Browser support includes Chrome, FireFox, Safari, Internet Explorer 7 and higher.

Basic usage

tinycal.init( { container: document.body } ) - Will render a default unstyled date picker. The container option is the only required option, the others can be left out.

Demo

http://sunmer.github.com/tinycal/

Default options

var options = {
  calendarID: the id attribute for the date picker table which is generated. Default: 'tinycal',
  callback: callback method when a date has been clicked. Default: null,
  container: DOM object which tinycalendar is appended to. Example: document.body, 
  month: the initial month which is rendered. Default: current month, 
  year: the initial year which is rendered. Default: current year,
  fullWeek: array of days which represents the week. Default: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
  fullYear: array of months which represents the year. Default: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
  sunStart: start the week on sunday (true) or monday (false). Default: false
}

Example options

var options = {
  calendarID: 'myCalendar',
  callback: function(date) { alert(date); }, 
  container: document.getElementsByTagName('body')[0], 
  month: 4, 
  year: 2017,
  fullWeek: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'],
  fullYear: ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'oktober', 'november', 'december'],
  sunStart: true
}

tinycal.init(options);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.