Date Range

Overview

Filter content by start date, end date, or both.

Available Options

Name Description
Other data source Use this setting if you want to use a separate value for the End Date
Compare type This setting appears when Other data source is in use

Basic: the post’s range is inside the user-selected range
Enclose: the post’s range surrounds the user-selected range
Intersect: the date ranges intersect at least partially

Fields to show “Start + End Dates”, “Exact Date”, “Start Date”, or “End Date”
Display format The front-facing date (see “Formatting tokens”)

Formatting tokens

  • d – day (2 digits)
  • j – day
  • m – month number (2 digits)
  • n – month number
  • F – month (full)
  • M – month (short)
  • y – year (last 2 digits)
  • Y – year (full)

Examples:

  • Y-m-d (2021-01-18)
  • F j, Y (January 18, 2021)
  • j M Y (18 Jan 2021)

Notes

Make sure custom field values are stored as YYYY-MM-DD or YYYY-MM-DD HH:MM:SS. Otherwise, use the facetwp_index_row hook to format the value for indexing.