filter_sub_year (zotonic_mod_base v1.0.0-rc.17)

Subtracts a year from a date. The value must be of the form {{Y,M,D},{H,I,S}}.

For example:

{{ value|sub_year }}

When the value is {{2008,12,10},{15,30,0}} then the output is {{2007,12,10},{15,30,0}}.

The filter has an optional argument which defines the number of years to subtract:

For example:

{{ value|sub_year:3 }}

When the value is {{2008,12,10},{15,30,0}} then the output is {{2005,12,10},{15,30,0}}.

See also

sub_day, sub_week, sub_month, add_year

Summary

Functions

sub_year/2

sub_year/3