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

Update jquery-ui-timepicker-addon.js #753

Closed ylorant closed 10 years ago

ylorant commented 10 years ago

Fixed a big bug on the "go to today" functionnality. When the month is not the current month, the date change didn't work, because the div ".ui-datepicker-today" was not there.

trentrichardson commented 10 years ago

Thank you for the fix. I will be testing dev and merge when all seems stable.

trentrichardson commented 10 years ago

@ylorant Can you describe your exact issue or provide an example?

When I visit the docs on the live documentation page and go to examples, there is an example under Alt fields with an old date in a previous month pre populated. I open the picker, click Now and everything works as expected.

http://trentrichardson.com/examples/timepicker/

With the dev version using the these changes the Now button works, but it immediately closes the picker and leaves focus on the input. Which means I have to click off the input to blur, and refocus to reopen the datepicker.

Can you help clarify your issue and fix?

ylorant commented 10 years ago

Yeah, the problem was when the input was already modified at the page load (let's say, you're editing you're birthday on your profile page). When the month selected is different from the current month, the selection of today's date didn't work, because the block representing the current date didn't exist. The fix now, instead of simulating a click on the current date, does a proper setDate() to the current day.