An open API service indexing awesome lists of open source software.

https://github.com/propan/yadatepicker

yet another date picker - a lightweight, customizable date picker plugin for jQuery
https://github.com/propan/yadatepicker

Last synced: 19 days ago
JSON representation

yet another date picker - a lightweight, customizable date picker plugin for jQuery

Awesome Lists containing this project

README

          

yaDatePicker - yet another datepicker
========================================================

A lightweight, customizable datepicker plugin for jQuery

[DEMO and Examples]( http://propan.github.com/yaDatePicker/ "Demo and Examples")

### Features

- inline calendar rendering
- the first day of the week selection
- custom date format
- localization
- themes support
- date selection restrictions [dates from the past, end date]

How to use
----------

### Step 1 - Setup

yaDatePicker plugin uses the jQuery JavaScript library.
So, in order to use it, include these two javascript files in the header of your page:


Include the CSS file that contains the theme for the yaDatePicker plugin you want to use:

### Step 2 - Activate

Create an input field or a div element to which you want to attach the datepicker:

or

Finally, attach a datepicker to the created field:

$("#date").attachDatePicker();

or render it to the created div element:

$("#calendar").attachDatePicker({inline:true});

### Step 3 - Have fun!

Options
-------

* inline - a boolean parameter that tells if datepicker should be attached or rendered as inline calendar

Default: false

* firstDay - the first day of the week

Default: 0 (Sunday)

* navigation - a flag to control appearance of the calendar navigation bar

Default: true

* allowPast - a flag that restricts selection of dates from the past

Default: true

* endDate - a last date that is allowed to be selected

Default: -1 (unlimited)

* theme - a name of datepicker theme. Three themes are included: dp, dark and grey

Default: 'dp'

* format - a format of the date. Available options are: d - day, m - month, y - two digit year, Y - four digit year

Default: 'd.m.Y'

* initial - an initial value of selected date. A string in the format supported by Date.parse() function or an instance of Date object.

Default: current date

* onSelect - a callback function which is called when the user selects date

Example:

function (date) {
alert(date);
}

Version History
---------------

Version 1.0 - 01/03/2012

- first release

Version 1.1 - 08/06/2012

- fixed an issue with incorrect month change
- changed onSelect behavior

Version 1.2 - 16/07/2012

- fixed an issue that occurred during simultaneous rendering of several calendars on the same page
- added an option for initial selected date

Version 1.3 - 13/10/2012

- added a mediator that allows to set a date of an attached calendar programmatically

License
-------
Copyright (c) 2012 Pavel Prokopenko Released under MIT License.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.