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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

[solved] DateFormat in HasOneComplexTableField

Go to End

11 Posts   2363 Views


Community Member, 344 Posts

18 August 2011 at 2:35am

Edited: 18/08/2011 2:38am

Hi there. Just add the following code to your HasOneComplexTableField.

$tablefield = new HasOneComplexTableField();
$tablefield->fieldCasting = array(
'Date' => array("Date->Format","d-m-Y"),

You can use array("Date->FormatI18N","%d. %B %Y") for a even nicer date too.


Community Member, 91 Posts

18 August 2011 at 2:42am

Thanks Devlin (and martimiz), It works!


Forum Moderator, 1391 Posts

18 August 2011 at 3:12am

@Devlin - nice!

Go to Top