Jump to:

23479 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » [Solved] SS 3.03 - Date format nog working

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

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

Page: 1
Go to End
Author Topic: 695 Views
  • borriej
    Avatar
    Community Member
    267 Posts

    [Solved] SS 3.03 - Date format nog working Link to this post

    BlogHolder.ss:

    $Date.FormatI18N(%e %b %Y)

    Config:

    i18n::set_locale('nl_NL');
    i18n::set_date_format('dd-MM-YYYY');
    setlocale(LC_ALL, 'nl_NL');
    setlocale(LC_TIME, 'nl_NL.UTF-8');
    date_default_timezone_set('Europe/Amsterdam');

    should result in "17 Dec 2012"
    instead i get an error: "Missing argument 1 for Date::FormatI18N()"

    [Warning] Missing argument 1 for Date::FormatI18N(), called in /storage/web/public/sites/new.url.nl/framework/view/ViewableData.php on line 366 and defined
    GET /blog/?flush=all
    Line 149 in /storage/web/public/sites/new.url.nl/framework/model/fieldtypes/Date.php

    a test on the server, using test.php

    <?php
    echo strftime("%e %b %Y");

    does result in 17 dec 2012, so i think the server is set correctly..

    is something wrong with this in SS 3.03?
    i saw "dospuntocero" also had problems in SS 3, see the irc logs: http://logs.simon.geek.nz/index.php?date=2012-07-05

    How do we fix this?

    SOLVED:
    Use $Date.FormatI18N('%e %b %Y')

  • sashion
    Avatar
    Community Member
    23 Posts

    Re: [Solved] SS 3.03 - Date format nog working Link to this post

    Thanks for that one. Just stumpled over it trying to update from SS2.4.5 to SS3.

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