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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1914 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