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

datepicker('setDate', 'string form of date') fails because timepicker insists on input field's value #735

Open rretter opened 10 years ago

rretter commented 10 years ago

in the routine _addTimePicker(), the line:

var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();

goes to the input field to get a value. which is fine, UNLESS you specifically called the datepicker routine in the form shown in my subject line. you might do this because you wanted to use A DIFFERENT VALUE and so PASSED ONE EXPLICITLY.

there seems to be an assumption embodied in the code that "the input field is all", which is plainly false in such a use case.

RodrigoBalest commented 9 years ago

Same issue here. I may send a pull request when I have some spare time!