7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Localization of the date
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1664 Views |
-
Localization of the date

5 October 2009 at 9:45am
Localization of the date
what to do to change the date format from
1 septembet 2009
at
1 ВереÑÐ½Ñ 2009I use
'Date' => 'Date',
and
new CalendarDateField('Date'),in config.php
I writeObject::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale('uk_UA');
but this does not help -
Re: Localization of the date

11 October 2009 at 8:39am
I don't think there is a localization of the date printing in Silverstripe. You should look at the intl extension available beginning from PHP 5.3 (or PHP 5.2 using PECL).
-
Re: Localization of the date

12 October 2009 at 1:25am
Localized dates in PHP are generated with strftime() instead of date(). I believe there's a way to get access to that in the Date class. Look at Date.php for a function like i18nFormat().
-
Re: Localization of the date

13 October 2009 at 2:43am
Try adding this line:
setlocale(LC_ALL, 'uk_UA.UTF8', 'uk_UA', 'uk-UA'); // Needed for dates
| 1664 Views | ||
|
Page:
1
|
Go to Top |


