Hi all,
I have added the article pages & holder, for some reason I have no dates on my holder or article pages, if I remove the .Nice from $Date.Nice I get a date, but its not very nice...
any ideas why $Date.Nice is not working?
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi all,
I have added the article pages & holder, for some reason I have no dates on my holder or article pages, if I remove the .Nice from $Date.Nice I get a date, but its not very nice...
any ideas why $Date.Nice is not working?
Have you set the Date using a Date field for the $db array? And using the DateField object for your date?
eg.
static $db = array(
'Date' => 'Date'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new DateField('Date', 'Date'), 'Content');
}