I have been doing some testing whilst using Jquery UI datepicker and have found that the date format doesn’t work correctly with Chrome – if I type 13/10/2009 an error appears saying that it is incorrect format. What I think has happened is that the format is dd/mm/yyyy for all browsers and validation but for some reason chrome has defaulted to mm/dd/yyyy – i.e. it works fine across all other browsers but not Google Chrome.
Here’s a link: https://www.carcreditassured.co.uk/apply-now-poor-rating/ (on this occassion I’m going to change the question type to three select boxes to aid usability but I would like to know an answer for future reference)
Here’s my jquery code:
$('.date-pick').datepicker({
showOn: 'both',
buttonText: 'Choose a date',
buttonImage: '/images/calendar.png',
buttonImageOnly: true,
dateFormat: 'dd/mm/yy',
numberOfMonths: 1,
showButtonPanel: true
});
Any advice would be greatly appreciated.
Best wishes
Rachel
P.S. After reading another post on this forum I tried to captialise the MM and that gives a format of (13 October 2009) which isn’t what i’m looking for.
I think it looks at the browser’s Locale settings (for google, go to chrome://settings/language)
You’ll need to set it for your picker control like so:
having said that, your picker results in dates in dd/mm/yyyy format for me even if I set Google Chrome to use American English, albeit the week starts with Sunday, so it’s still influenced unless you set control’s culture as per code I’ve provided.