Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters · mod_base
  • Reference
  • Frontend developer
  • Template filter
  • Compare
  • Boolean
  • Date and time

in_past

Module

mod_base

Tests if a date is in the past.

Tests if the value is a date and in the past. 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, the result is undefined.

For example:

{% if value|in_past %}Those days have gone.{% endif %}

This outputs “Those days have gone.” if the value is a date and in the past.

Edit on GitHub

Related documentation

Filters

eq_day

Tests if the value is a date and equal to the argument. The value and the argument must be a tuple of the format {Y,M,D} or {{Y,M,D},{H,I

Filters

in_future

Tests if a date is in the future.

Filters

ne_day

Tests if two dates are not equal.

Filters

survey_is_history_back

Test whether a survey respondent may return to the previous page in a history.

Filters

survey_is_save_intermediate

Check if the given survey is configured to save intermediate results. Always returns a boolean value.

Filters

default_if_none

Provide an alternative value in case a value is undefined.

Filters

default_if_undefined

Provide an alternative value in case a value is undefined.

Filters

survey_is_pagebreak_submit

Check if a list of questions contains a pagebreak block with an unconditional submit.

Filters

if

Selects an argument depending on a condition.

GitHub © 2026 Zotonic