Closed krasi-georgiev closed 9 years ago
Just now realised that this is a timepicker issue so will post the issue there
This appears to be a Datepair issue, not a timepicker issue.
I can't debug this without seeing code. Can you post a jsFiddle that demonstrates the problem, or provide steps to reproduce on the Datepair demo page?
Here is a an example of a broken code: https://jsfiddle.net/dLLa6w2e/
vasically if the field has some data it brakes the timepicker.
there might be a way to pre populate the field with js , but I don't think that having some data in the field should brake the plugin.
You're initializing the datepair before initializing the timepickers and datepickers. This block
$('.date_time_pair').datepair({
parseDate: function (el) {
var utc = new Date($(el).datepicker('getDate'));
return new Date(utc.getTime());
},
updateDate: function (el, v) {
$(el).datepicker('setDate', v);
}
});
initializes the datepair. It needs to go after the timepicker and datepicker calls. You can remove the second call to datepair()
.
Thanks that worked.
http://screencast.com/t/QxJJY86biT
when I submit a form and one of the fields fails the server validation the time inout field will include the submitted value but datepair returns an error.
I tried to fix in the code , but not enough knowledge.