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.

General Questions /

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

[Solved] SS 3.03 - Date format nog working


Reply


2 Posts   837 Views

Avatar
borriej

Community Member, 267 Posts

18 December 2012 at 3:43am

Edited: 18/12/2012 3:49am

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

Avatar
sashion

Community Member, 23 Posts

18 August 2013 at 12:29am

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