Jump to:

7607 Posts in 1236 Topics by 846 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

Page: 1
Go to End
Author Topic: 1453 Views
  • fiord
    Avatar
    Community Member
    70 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
    4050 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
    301 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

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