Search code examples
javascriptjquerydatepickerdatetimepickertimepicker

Having two jQuery datepickers on the same page


I'm using Timepicker (extended Datepicker from jQuery UI here). My code:

$('.one').datepicker({
    dateFormat: "d"
});
$('.two').timepicker({
    timeFormat: "hh"
});

When I click on field .two, Firebug shows me an error:

Error parsing the date string: Unexpected literal at position 2

date string = 10

date format = mm/dd/yy

timepicker.js (line 1911)

Everything seems to work just fine, but I wonder why is this error showing up and how can I make it disappear?

EDIT: Actually my code looks like this:

$('.one').datepicker({
    dateFormat: "d m y"
});
$('.two').timepicker({
    timeFormat: "hh mm"
});

EDIT2: http://jsfiddle.net/r9bCk/


Solution

  • Gury, Try to include the addon v.1.1.0 from here, and hopefully it resolves the error. It's the same version I'm using. Clearly there's a bug in the new versions.