Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#251 locale_format in language.inc does not return proper locale to match date format

Minor
open
nobody
4
2012-11-06
2012-11-06
James
No

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.

Discussion

  • James
    James
    2012-11-06

    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.

     


Anonymous


Cancel   Add attachments