Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » $Date.RangeString question

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: 771 Views
  • iadawn
    Avatar
    Community Member
    13 Posts

    $Date.RangeString question Link to this post

    Hi,

    How is $Date.RangeString envisaged to work?

    If I put:

    $StartDate.RangeString( EndDate )

    in a template. The error:

    Fatal error: Call to a member function DayOfMonth() on a non-object .../sapphire/core/model/fieldtypes/Date.php on line 87

    Occurs. This is because what is passed into RangeString is simply the string 'EndDate'. If I put:

    $StartDate.RangeString( $EndDate )

    in a template. The error:

    Parse error: syntax error, unexpected T_STRING, expecting ')'

    is raised from the cache. A quick look there shows:

    $val .= $item->obj("StartDate")->XML_val("RangeString",array("
    SSVIEWER;
    $val .= $item->XML_val("EndDate",null,true) ;
    $val .= <<<SSVIEWER
    "),true) ;
    $val .= <<<SSVIEWER

    Which I am guessing is a bit of a wrong 'un. Is this an issue with the template parser?

    Any thoughts would be appreciated.

    Kevin

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