locale_format in language.inc does not return proper locale to match date format
Brought to you by:
jberanek
When using a $override_locale of "en_GB.utf-8" or "en_AU.utf-8" the DatePicker does not use the correct dd/mm/yy date format, and instead uses mm/dd/yy.
In the systemdefaults.inc.php file it gives an example of $override_locale as "en_GB.utf-8".
However, if this is passed to locale_format in language.inc it returns "en-GB.UTF-8" rather than "en-GB".
As this is how the datepicker.js.php fills in all the datepicker locales to match those in jquery-ui-18n.js it will fail to match the correct date format.
One solution is to update locale_format to strip out the .utf-8 before sending back the correct en-GB or en-AU which would then match in datepicker.
Same happens if en_AU.utf-8 is used as the $override_locale.
Please close this ticket. I missed an important line in datepicker.js.php that resolves this issue.
$datepicker_locale = substr($datepicker_locale, 0, 5);
Apologies.
Closed as requested.