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.

Archive

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

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

$Date.RangeString question


Reply

783 Views

Avatar
iadawn

10 September 2008 at 11:34am Community Member, 13 Posts

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