Date filtering in Custom Filters

EZ Exporter for Shopify: Custom Date Filters

We provide a flexible way to filter date fields (such as the Created At, Updated At, and Processed At fields) in the Custom Filters. Note that these fields are really timestamps and contain not just the date but also the time and timezone in ISO 8601 format.

Since the dates also include the time, you'd normally only filter these fields with the is greater than or is less than filter conditions.

We also provide special date variable keywords such as {{ current_date }} that you can use when filtering date fields. Note that by default, {{ current_date }} will have the time 00:00:00. If you need to filter by a specific time you can append the time to it like this (in ISO 8601 format):

{{ current_date }}T23:59:59

You can also add and subtract days to {{ current_date }}, for example:

Subtract 1 day.

{{ current_date }} - 1

Subtract 7 days.

{{ current_date }}T23:59:59 - 7

If you need to hardcode dates in the filter, just make sure it's in ISO 8601 format.

2017-03-31
2017-03-31T08:30

We'll automatically handle the timezone for you based on your store's timezone setting.

Below is the full list of available date variables:

  • {{ current_date }} (e.g. 2018-05-13)
  • {{ current_year }} (e.g. 2018)
  • {{ current_month }} (e.g. 05)
  • {{ current_day }} (e.g. 13)
  • {{ previous_month }} (e.g. 04)
  • {{ previous_month_with_year }} (e.g. 2018-04 , if the current month is January, then this will be 2017-12)
  • {{ last_successful_run }} (the start timestamp of the last successful run of the Export Profile associated with the Data Settings)

Just to summarize:

  • You'd normally want to use only the is greater than or is less than filter conditions.
  • The date and time format must be in ISO 8601.
  • You can add and subtract days when using the special date variables keyword.
  • We'll handle the timezone in the backend based on your store's timezone setting.

Examples

I want to filter my Product export to only include the variants that were updated yesterday.

Data matching all of the following conditions:

  • Variant Updated At is greater than {{ current_date }} - 1
  • Variant Updated At is less than {{ current_date }}

(Note here that the time by default is 00:00:00.)

I want to filter my Order export to only include orders that were placed between 9:00 AM and 4:30 PM today.

Data matching all of the following conditions:

  • Created At is greater than {{ current_date }}T09:00
  • Created At is is less than {{ current_date }}T16:30

I want to filter my Customer export to only include customers that were updated in the last 14 days.

Data matching all of the following conditions:

  • Updated At is greater than {{ current_date }} - 14


App: EZ Exporter

Tags: advanced features