trentrichardson / jQuery-Timepicker-Addon

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

Setters for hourMin, hourMax and stepMinute do not work #195

Open kiroff opened 13 years ago

kiroff commented 13 years ago

Hi,

First of all thanks for your work, looks very useful for me!

Second I'm trying do set the above fields dynamically (using 0.9.5), after the datetimepicker had been initialised and before it appears using:

$(params[0]).datetimepicker("option", "hourMin", 8); $(params[0]).datetimepicker("option", "hourMax", 22); $(params[0]).datetimepicker("option", "stepMinute", 15);

with no luck. If I pass this options when datepicker is initialised it works.

Tried the dev branch rev b53bf326f4fa34f57bf2 - same thing.

yanickrochon commented 13 years ago

in fact, there doesn't seem to have any setter method on this widget.... I tried updating the minDate, and seeing that it did nothing, I look into the code to notice that the code did not follow the jQuery UI widget factory. This code should be refactored to follow the guidelines and could very well be presented as an update to the current datepicker widget.

Nice work, though.

TatianaTyu commented 12 years ago

stepMinute does not work for me either, so does minuteGrid

TatianaTyu commented 12 years ago

Hey guys, looks like settings' order is important. When I put stepMinute setting to the end like this (in CoffeeScript):

$(".datetime").datetimepicker( dateFormat: 'M d, yy', showOtherMonths: true, selectOtherMonths: true, showButtonPanel: false, numberOfMonths: 2, ampm: true, timeFormat: 'hh:mm TT', hourGrid: 2, minuteGrid: 10, stepHour: 1, stepMinute: 5 )

... then it does not work. But when I put it to the beginning, it does.

keithnicholson commented 12 years ago

I believe this was fixed with 1.0.2. Give it a try now. Using options should work.