Closed padders closed 8 years ago
Note that the validation works fine when all the datepickers and datepair are set to 'mm/dd/yyyy'. Unfortunately living in the UK the client isn't happy with that.
Datepair doesn't try to parse dates itself - it relies on the parseDate
option, which defaults to asking the datepicker plugin for the date. If you post a jsFiddle or some other working example I might be able to help, but this sounds like an issue with the datepicker and not datepair.
Hi Jon, yeah I came to that conclusion myself. I ended up updating the jquery date validation manually which seems to work fine. Thanks for the response :)
Hi,
I hope I'm not doing something stupid here!
I've set the format of all my datepickers to 'dd/mm/yyyy' and then set the format of the datepair to the config below
$('#dateAndTime .date').datepicker({ format: 'dd/mm/yyyy', autoclose: true });
Now when I put in a date such as 16/03/2016 where the day is higher than 12 (as there are only 12 months) I get a 'Please enter a valid date' error.
I'm assuming JQuery is trying to validate the date using the US format of mm/dd/yyyy but I can't for the life of me figure out how to change that, or even if it's possible.