mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
date & time to the value closest to the current datetime
date & time to the value closest to the current datetime
This commit is contained in:
parent
b8892a575f
commit
7bb28f1ded
@ -11,7 +11,7 @@
|
||||
"timepicker",
|
||||
"datetimepicker"
|
||||
],
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"author": {
|
||||
"name": "Chupurnov Valeriy",
|
||||
"url": "http://xdsoft.net/contacts.html"
|
||||
|
@ -14,7 +14,7 @@ $('#datetimepicker').datetimepicker({value:'2015/04/15 05:06'});
|
||||
$('#datetimepicker1').datetimepicker({
|
||||
datepicker:false,
|
||||
format:'H:i',
|
||||
value:'12:00',
|
||||
step:5,
|
||||
});
|
||||
$('#datetimepicker2').datetimepicker({
|
||||
timepicker:false,
|
||||
|
@ -251,7 +251,11 @@
|
||||
(options.maxTime!==false&&xd.strtotime(options.maxTime).getTime()<now.getTime())||
|
||||
(options.minTime!==false&&xd.strtotime(options.minTime).getTime()>now.getTime())
|
||||
?'xdsoft_disabled ':' ')+
|
||||
((parseInt(xd.currentTime.getHours())==parseInt(h)&&parseInt(xd.currentTime.getMinutes())==parseInt(m))?' xdsoft_current ':'')+
|
||||
(
|
||||
(parseInt(xd.currentTime.getHours())==parseInt(h)
|
||||
&&
|
||||
parseInt(xd.currentTime.getMinutes()/options.step)*options.step==parseInt(m)
|
||||
)?' xdsoft_current ':'')+
|
||||
((parseInt(today.getHours())==parseInt(h)&&parseInt(today.getMinutes())==parseInt(m))?' xdsoft_today ':'')+
|
||||
'" data-hour="'+h+'" data-minute="'+m+'">'+now.dateFormat(options.formatTime)+'</div>';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user