Add option for selection by month, e.g., thismonth
Posted May 10th, 2008 by douggreen
5.x-1.7, Code, feature request, normal, active
In conjunction with the Views Group-By Pack, I'd like to be able to filter nodes on month boundaries relative to the current date. For example, if showing "future" events I'd like them to be after the first of the current month so the actual nodes listed would correspond with the implied monthly grouping.
As a quick and dirty solution I added the following code at about line 285 in daterange.module:
case 'thismonth': $cmtmon = date("n", time()); $value = mktime( 0, 0, 0, $cmtmon , 1); // 0H, 0M, 0S, (current month), Day 1, (current year) break;
This is in the middle of the _get_date_named_value function just following the code for "weekago".
Thanks, and thanks for this useful filter.