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've moved the forum!

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.

Archive /

Our old forums are still available as a read-only archive.

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

$Date.Nice


Go to End


2 Posts   2704 Views

Avatar
vetoo

Community Member, 2 Posts

3 May 2007 at 7:56am

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?

Avatar
Sean

Forum Moderator, 922 Posts

3 May 2007 at 10:13am

Edited: 03/05/2007 10:14am

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