defaults = {
datetime: NaN,
locale: navigator.language,
format: {
},
minDate: NaN,
maxDate: NaN,
minTime: NaN,
maxTime: NaN
}
defaults = {
datetime: NaN,
locale: navigator.language,
format: {
},
minDate: NaN,
maxDate: NaN,
minTime: NaN,
maxTime: NaN
}
In according to http://cldr.unicode.org/translation/date-time, the following table lists the characters that you can use in a pattern for formatting or parsing strings in relation to a dateTime.
Symbol | Meaning | Format | Example |
---|---|---|---|
yy | 2-digit year | dd.M.yy | 05.03.17 |
yyyy | 4-digits yeaar | dd.M.yyyy | 05.03.2017 |
M | 2-digits month | dd.M.yyyy | 05.03.2017 |
MM | short month | dd MM yyy | 05 сент. 2017 notice that some short month already includes the dot so recommended format would be 'dd MM yyyy' |
MMM | 1-letter month | dd MMM yyyy | 05 C 2017 |
MMMM | full month name | dd MMMM yyyy | 05 январь 2017 |
L | Stand-Alone month name | dd L yyyy | 05 января 2017 |
d | 1-digit day | d L yyyy | 5 января 2017 |
dd | 2-digit day | dd L yyyy | 05 января 2017 |
EE | short weekday | EE dd L yyyy | чт 05 января 2017 |
EEE | 1-letter weekday | EEE dd L yyyy | Ч 5 января 2017 |
EEEE | full weekday | EEEE dd L yyyy | четверг 5 января 2017 |
h | 1-digi hour in 12 hours format | h:mm:ss | 8:15:33 |
hh | 2-digits hour in 12 hours format | hh:mm:ss | 08:15:33 |
H | 1-digit hour in 24 hours format | H:mm:ss | 8:15:33 |
HH | 2-digit hour in 24 hours format | HH:mm:ss | 08:15:33 |
m | 1-digit minute | hh:m:ss | 08:1:03 |
mm | 2-digit minute | hh:mm:ss | 08:01:03 |
s | 1-digit second | hh:mm:s | 08:01:3 |
ss | 2-digit second | hh:mm:ss | 08:01:03 |
a | AM/PM | hh:mm:ss a | 08:01:03 AM |
setTime, getTime, setOptions, destroy
$('selector').datetime('setTime', Date || timestamp || timestring );
$('selector').datetime('getTime');
$('selector').datetime('setOptions', { option: value })
$('selector').datetime('destroy')
Plugin supports numeric input, arrow keys and mouse scroll.
$('selector').datetime();
$('selector').datetime({ datetime: 0 });
$('selector').datetime({
datetime: '01/03/1976 21:53',
locale: 'ru',
format: 'dd L yyyy HH:mm '
});
$('selector').datetime({
datetime: Date.now(),
minDate: Date.now()
});