Time Since

1.6.4 (Aug 17, 2021) — Download from your account page

The Time Since facet is used to filter posts by date / time since a specified interval.

Setup

  • Data Source: A date; “Post Date”, “Post Modified”, or a custom field in YYYY-MM-DD format
  • Choices: the choices to display (one per line). The label and formatter are separated by “|”. Example:
Past Day | -1 day
Past 7 Days | -7 days
Past 30 Days | -30 days
Past 90 Days | -90 days
Past Year | -1 year
Next 7 Days | +7 days
Today | today
Tomorrow | tomorrow
Yesterday | yesterday

The formatter is based on PHP’s strtotime function (see example).

Changelog

1.6.4

  • Fixed user selections feature was empty
  • Fixed use JS versioning to bust caching

1.6.3

  • Fixed filtering broken when labels are translated using `facetwp_i18n` hook

1.6.2

  • Improved changed textdomain to `facetwp-time-since`
  • Fixed choice labels can now be translated via the `facetwp_i18n` hook
  • Fixed undefined $token variable (props Rhys)

1.6

  • New revamped filtering logic to support "today", "tomorrow", and "yesterday"

1.5.1

  • Changed replaced `wp.hooks` to `FWP.hooks` due to conflict with WP 5.0