DatePicker
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Lightweight javascript date picker
# Lightweight javascript datepicker

![Lightweight javascript datepicker](http://remi-grumeau.github.io/DatePicker/images/preview.png "Javascript DatePicker")

This script is a modern browser automatic date picker solution. 
No third-party library dependency, IE support is IE8+.

See [live demo](http://remi-grumeau.github.io/DatePicker/demo/datepicker-demo.html).


# How to use
### Simple usage

First, you need to put a table element inside your page which the library can use to generate the calendar.

```html
``` For a given id attribute of 'birthday', you should have - an input text with id equal to 'birthday' - an onclick event on it to open datepicker ```html ``` ### Positionning You can specify a second parameter to specify the datepicker position. If empty, datepicker use the first parameter (aka element ID value) to get its position. It can be an element ID value, a DOM element or a X,Y array. ```html ``` ### On multiple selects For a given id attribute of 'birthday', you should have - 3 selects with ids 'birthday_day', 'birthday_month' & 'birthday_year'. - an hidden input text with id equal to 'birthday' ```html ``` Please note that in this case, it might be a good idea to add onblur events on select to update the hidden input value when a select value changes. ### Onchange event callback DatePicker can also trigger a function on ```html ``` ## API ####DP._locale An object contains a "months" array, and a "days" array. ```months[]``` goes from 0 to 11 as 'January' to 'December', and ```days[]``` goes from 0 to 6 as 'Sun' to 'Sat'. ####DP.gbi(eid) Just a shortcut to ```document.getElementById```. ####DP.formatDate(d,m,y) A function to return a well formated ```yyyy-mm-dd``` string from strings or integers. ```ex: DP.formatDate(2,6,1982) ---> "1982-06-02"``` ####DP.toString(d) Returns a human friendly date from a well formated ```yyyy-mm-dd``` string. ```ex: DP.toString('1982-06-02') ---> "June 2th, 1982"``` ## Want to contribute? Any contribution is always welcome. As an example, Responsive CSS and multilingual support would be pretty nice contributions :) ## Special thanks Thanks to [DtTvB's work](http://javascriptkit.com/script/script2/dyndateselector.shtml), DatePicker really start as a cleanup of it.

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。