Date Views

Date Range Argument

A flexible date range argument is provided in views. The date range argument is based on the ISO 8601 week, duration, and time interval standards. The argument expects a value like 2006-01-01T12:30:00--2006-01-15, or 2006-W24, or @P1W. Separate from and to dates with a separator, a double hyphen (--). The from and to dates in argument are ISO dates, but parts can be omitted, and will be assumed to be the first possible (for the from date) or the last possible (for the to date) value in that time period. The \'to\' portion of the argument can be eliminated if it is the same as the \'from\' portion. Use @ instead of a date to substitute in the current date and time.

Examples of views date range arguments:

ArgumentResulting Query Range
2006-W2424th ISO week in 2006
2006the whole year of 2006
2006-03the whole month of Mar 2006
2006-02--2007-03-15Feb 1 2006 to Mar 15 2006
2006-08-31T14:00:00P2Hthe 14th to 16th hours of Aug 8 2006
@--2006-12-31NOW to 2006-12-31T23:59:59
@P3HNOW to three hours from now
@P1Y90DNOW to 1 year and 90 days from now
2006-03-05P1Wthe 1 week period starting Mar 5 2006
2006-01P3Mthe 3 month period starting Jan 2006

Date Browser

A Date Browser plugin is available to add back/next navigation links to a view that uses the date range argument. Also adds "week of XXX", "month of XXX" headings to views and blocks and defaults blocks and views w/out arguments to current period to start paging.

To use the Date Browser: