[[pdoResources?
parents=`1`
&depth=`1`
&sortby=`menuindex`
&sortdir=`ASC`
&where=`{"date:>=":"[[!getDate]]"}`
&tpl=`myTpl`
&select=`id,pagetitle,longtitle,description,content`
&includeTVs=`date`
]]This question has been answered by Bruno17. See the first response.
First, create a small snippet (I called mine curDate) to return the current datetime string:
<?php return date('Y-m-d H:i:s');
Then you can use the getResources tvFilters using this snippet:
Current events:
[[!getResources? ... &tvFilters=`myDateTV>=[[curDate]]` ]]
Past events:
[[!getResources? ... &tvFilters=`myDateTV<<[[curDate]]` ]]
&tvFilters=`date>>[[curDate]]`
[[!getResources:default=`<p><i>No entries found...</i></p>`?
&parents=`...`
&tpl=`...`
&tplWrapper=`...`
&where=`{"unpub_date:<":"[[+mydate]]"}`
&sortby=`{"unpub_date":"ASC"}`
&limit=`0`
]]
[[+unpub_date:gt=`[[+mydate]]`:then=`greater`:else=`smaller`]]
[[+mydate]]
&where=`{"unpub_date:<":"[[+mydate:strtotime]]"}`