Content Views Pro helps you to filter by a date custom field easily. Here is how:
In Filter Settings tab, please select the Custom Fields checkbox.
In the “Filter by Custom Fields” box, click Add New button, then:
- select the name of date field for “Field Key”
- select the Date (or Date Time) option for “Value Type”
- select option to compare in “Operator To Compare” setting. There are many options which work for all your needs:
- Now & Past
- Now & Future
- In the past
- Equal ( = )
- Differ ( != )
- Greater ( > )
- Greater or Equal ( >= )
- Less ( < )
- Less or Equal ( <= )
- Not Exists
- select the value for “Value To Compare” if needed. Some of above options don’t require value.
Here is a sample to filter upcoming events:
With Content Views Pro version 22.214.171.124 and before, filter by a date custom field only supports field which has value in YYYY-MM-DD (year-month-date) format.
If the field doesn’t has that format, you will need to create an alias field.
Assuming you have some events, each event has a custom field “Start Date”. Value of these custom fields are somethings like 10 Sep 2015, 9 Oct 2015…
Because value of this field is not in format YYYY-MM-DD, we have to create a new custom field (read more here):
– give it a custom name (for example: cvp_start_date)
– convert value of the field “Start Date” to YYYY-MM-DD format, to set as value of this field. For example, the value of “Start Date” is “10 Sep 2015”, so value of the alias field is “2015-09-10”.