Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Localization of the date

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1839 Views
  • fiord
    Avatar
    Community Member
    79 Posts

    Localization of the date Link to this post

    Localization of the date
    what to do to change the date format from
    1 septembet 2009
    at
    1 Вересня 2009

    I use
    'Date' => 'Date',
    and
    new CalendarDateField('Date'),

    in config.php
    I write

    Object::add_extension('SiteTree', 'Translatable');
    Translatable::set_default_locale('uk_UA');


    but this does not help

  • denisrosset
    Avatar
    Community Member
    4 Posts

    Re: Localization of the date Link to this post

    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).

  • UncleCheese
    Avatar
    4085 Posts

    Re: Localization of the date Link to this post

    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().

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Localization of the date Link to this post

    Try adding this line:

    setlocale(LC_ALL, 'uk_UA.UTF8', 'uk_UA', 'uk-UA'); // Needed for dates

    1839 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.