Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DateField, locale and 2.4.0 rc1

Go to End

4 Posts   1817 Views

Bruce B

Community Member, 164 Posts

20 April 2010 at 2:58pm

I'm setting up a new site using 2.4.0 rc1. all is working very well except for the new DateField. I'm modifying an existing template that used CalendarDateField so the new version uses "setConfig('showcalendar')" to achieve the same interface. I'm in Australia so the limitation on showcalendar should not be a problem but ...

The datefield insists on using US style dates m/d/yr rather than d/m/yr. This means that the showcalendar output looks correct (d/m/yr) but fails validation. If I switch to 'dmyfields', the fields are listed in m/d/yr order. If I enter a valid US date manually, the field validates.

In my _config.php I have the line:

I have also added
to the page with the DateField

I can run legacydatetimefields and use the old CalendarDateField but the one time I tried, it included the time in the field as well as the date. I may be able to sort that one out but I'd really like to use the new version, if only I can get it to recognise the correct Locale.

Any suggestions as to where to look next to solve this problem?

Bruce B

Community Member, 164 Posts

22 April 2010 at 4:48pm

It appears that i18n is not recognising the locale in the _config.php file. After lots of fruitless effort, I gave up and did a gross hack on i18n.php so get_locale() now says:
return 'en_AU';


Forum Moderator, 801 Posts

4 May 2010 at 2:43pm

The js datepicker doesnt work with other locales (or at least we won't integrate it in core in this capacity). It'll be replaced by a more modern picker, for now the field has the same limitations as 2.3 in this regard. See

Bruce B

Community Member, 164 Posts

4 May 2010 at 3:16pm

It turned out that the problem was that my user account was set to en-US. Once I changed it to en-GB, the datepicker was fine.