trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Pressing 'now' will set time to Nan:An when stepMinute is set. #863

Open bdm4 opened 8 years ago

bdm4 commented 8 years ago

I am seeing similar issues to #845, #860.

My setup: $(".dtpick").datetimepicker({ stepHour: 1, stepMinute: 5, hour: 12, timeFormat: "h:mm tt" });

If my clock is on a 5 minute interval then it will work. So it seems like it's not rounding to the nearest stepped minute if stepping is set.

var now = new Date(); now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + tzoffset);

leek9 commented 8 years ago

This might be too late but here is a possible fix. Put it before that line and it should work. if (typeof tzoffset == 'string') tzoffset = parseInt(tzoffset);

Eaglef90 commented 8 years ago

I am on 1.6.1 and having this same issue except my stepMinute is set to 15.