Fix round time

Time is rounded to the nearest value
This commit is contained in:
Valeriy 2013-12-12 15:43:03 +06:00
parent c8fdf24bf3
commit 98f12c07dd
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ $('#datetimepicker_mask').datetimepicker({
mask:'9999/19/39 29:59',
});
$('#datetimepicker').datetimepicker();
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:06'});
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});
$('#datetimepicker1').datetimepicker({
datepicker:false,
format:'H:i',

View File

@ -653,7 +653,7 @@
(
(parseInt(_xdsoft_datetime.currentTime.getHours())==parseInt(h)
&&
parseInt(_xdsoft_datetime.currentTime.getMinutes()/options.step)*options.step==parseInt(m)
Math.round(_xdsoft_datetime.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>';