Go to page content

in_future

Tests if a date is in the future.

Tests if the value is a date and in the future.  The value must be a tuple of the format {Y,M,D} or {{Y,M,D},{H,I,S}}.  When the value is not a date, or datetime, then the result is undefined.

For example:

{% if value|in_future %}That day has to come.{% endif %}

This outputs “That day has to come.” if the value is a date and in the future.

This is useful in combination with for example the if tag.

See also the filter in_past.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.