Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

get dates later than today

$
0
0

I hate it when simple things trip you up. In my SS2.4 site I had the following line to collect all future events pages:

$littlechildren = DataObject::get("ArticlePage", "ParentID = $this->ID and Date >= CURDATE()", "Date ASC", null, null);

In SS3, I have this:

$holder = ArticleHolder::get()->filter('URLSegment', 'meetings')->first();
return ($holder) ? ArticlePage::get()->filter(array('ParentID' => $holder->ID,'Date:GreaterThan' => '2013-01-07'))->sort('Date DESC') : false;

I'd like to replace the string '2013-01-07' with CURDATE() but SS3 does not like CURDATE() in that context and considers it an undefined function.

What's the best solution?

cheers
bruce


Posted to: get dates later than today | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles