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

Error parsing the date string when using timeOnly and setDate #553

Open SimonVanherweghe opened 11 years ago

SimonVanherweghe commented 11 years ago

I've modified the 'Restrict a start and end date' example to let the user select a start datetime and only the end time (same date). I propose an end time 3 hours later than the start time.

http://jsfiddle.net/donebysimon/pUfbd/21/

As you can see, it works, but it throws an error on parsing the date string. It seems like it expects a full date string, but only receives a time string. Am I doing something wrong here or is this a bug?

note: at the jsfiddle: it may be necessary to load the jquery-ui-timepicker-addon and slider.js first (click on them under manage resources)

trentrichardson commented 11 years ago

I haven't considered this type setup before (a time range with one datetime and one time), so this is good someone is bringing this up.

My first thought is the same as yours, timepicker is not expecting a date. You might try setting dateFormat: "" in the time only picker, that way it knows to expect no date. It may be something deeper though..