The jQuery UI
Datepicker is a highly configurable plugin that adds datepicker functionality
to your pages. You can
customize the date format.
- d – day of month (single digit where applicable)
- dd – day of month (two digits)
- o – day of the year (no leading zeros)
- oo – day of the year (three digit)
- m – month of year (single digit where
applicable)
- mm – month of year (two digits)
- y – year (two digits)
- yy – year (four digits)
- D – short day name
- DD – full day name
- M – short month name
- MM – long month name
- '...' – any literal text string
- @ - UNIX timestamp (milliseconds since 01/01/1970)
- ! – Windows ticks (100ns since 01/01/0001)
(function(){
var pickerOpts = {
dateFormat:"d MM yy"
};
$("#date").datepicker(pickerOpts);
});
predefined
date formats for datepicker
The complete set of predefined date formats
Option
value
|
Date
format
|
$.datepicker.ATOM
|
"yy-mm-dd"
|
$.datepicker.COOKIE
|
"D,
dd M y"
|
$.datepicker.ISO_8601
|
"yy-mm-dd"
|
$.datepicker.RFC_822
|
"D,
d M y"
|
$.datepicker.RFC_850
|
"DD,
dd-M-y"
|
$.datepicker.RFC_1036
|
"D,
d M y"
|
$.datepicker.RFC_1123
|
"D,
d M yy"
|
$.datepicker.RFC_2822
|
"D,
d M yy"
|
$.datepicker.RSS
|
"D,
d M y"
|
$.datepicker.TIMESTAMP
|
@
(UNIX timestamp)
|
$.datepicker.W3C
|
"yy-mm-dd"
|