Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » $Date.Nice

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

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

Page: 1
Go to End
Author Topic: 2010 Views
  • vetoo
    Avatar
    Community Member
    2 Posts

    $Date.Nice Link to this post

    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?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: $Date.Nice Link to this post

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

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