Skip to content

Instantly share code, notes, and snippets.

@muskie9
Created December 19, 2019 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muskie9/8a919ed53c8dab629628c965466c554f to your computer and use it in GitHub Desktop.
Save muskie9/8a919ed53c8dab629628c965466c554f to your computer and use it in GitHub Desktop.
<?php
/** DataList $myList */
$myList = Something::get();
$withinRangeFilter = new WithinRangeFilter('ColumnName');//in this case I had a Date column
$withinRangeFilter->setMin('YYYY-MM-DD');//low end date
$withinRangeFilter->setMax('YYYY-MM-DD');//high end date
$myList = $myList->alterDataQuery([$withinRangeFitler, 'apply']);
return $myList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment