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:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Date months in locale


Go to End


4 Posts   1621 Views

Avatar
Webdoc

Community Member, 349 Posts

4 May 2012 at 7:07am

How to get the month names in current locale
SS 2.4.7

Avatar
Willr

Forum Moderator, 5523 Posts

4 May 2012 at 6:37pm

Well $Now.Month returns the month name. It will return whatever locale you have set at the PHP level (setlocale()) I don't believe SS will set this automatically for you.

Avatar
Webdoc

Community Member, 349 Posts

4 May 2012 at 10:25pm

i use in mysite/_config.pgp lines:
i18n::set_locale('et_EE');
setlocale(LC_TIME, i18n::get_locale() . '.utf8');

But in blog module the months are still in english.
Blog module uses in posts:
$Date.Long
And in widget it also in english

Avatar
Webdoc

Community Member, 349 Posts

5 May 2012 at 5:53am

got it working with code $Date.FormatDate(%d %b %Y)
But still needed the code do make ArchiveWidget to show the title in right language