CASE: calculate with dates

We have added a bunch of date filters:

advance_year, retract_year, advance_years, retract_years, advance_month, retract_month, advance_months, retract_months, advance_week, retract_week, advance_weeks, retract_weeks, advance_day, retract_day, advance_days, retract_days, advance_hour, retract_hour, advance_hours, retract_hours, advance_minute, retract_minute, advance_minutes, retract_minutes, advance_second, retract_second, advance_seconds, retract_seconds

Isn’t that great? Saves lots of code!

You can do something like:

{% assign next_month = "now" | advance_month: 1 %}

{% input as:date %}

{% assign previous_month = | retract_month: 1 %}

The list goes on :slightly_smiling_face:
Hopefully you can find this useful in your templates.

for example this can now be shortened:

with this:

{% input custom.some.s_date as:date %}

{% assign old_date = custom.some.s_date  %}

{% assign new_date = old_date | advance_days:1 | advance_years:5  %}

The new date is {{ new_date | date:"%Y/%m/%d" }}