The daterange module provides a programatic extension for date ranges that can be used by other module developers. It creates new filters for node times, 'Node: Created Time Between' and 'Node: Changed Time Between', as well as new date range filters for CCK date (but not datestamp) fields.
If jscalendar is installed and enabled the date fields are augmented with the jscalendar button for selecting a date.
The supported operators are 'Custom date range', 'Outside date range', 'Before', 'After', 'within the past week', 'within the past month',
The date fields understand the words 'today' and 'yesterday' and subtraction of days, months, or years.
'today-1' is 'yesterday'
'today-7' is a week ago
'today-1M' is a month ago
'today-2Y' is two years ago
If you'd like additional operations or fewer operations, you can use the hook_form_filter to hook the form and change the options. Hint: make sure your custom modules weight is higher than this modules weight, so that your module runs after the daterange module.
- Install these files (daterange.module and daterange.js) in the modules directory of your choice (for example, sites/yoursite.com/modules/daterange or modules/daterange).
- Enable the daterange in the admin/modules page.
- Create a view and add the 'Node: Created Time Between' or 'Node: Changed Time Between' Filter.
- add default ranges for future dates
- add option the indicates if the default ranges should include past or future, (or both) ranges
This module is partially supported by CivicActions.