Skip to main content

Date & Time Filters

monthInWords (En/Cs)

Translates month index into month name (1 → January)

Examples:

  • in {{1|monthInWords}}in January (English)
  • v {{1|monthInWords|morph('Case=Loc')}}v lednu (Czech)

dayInWords (En/Cs)

Translates day index into day of the week name (1 → pondělí)

Examples:

  • on {{1|dayInWords}}on Monday (English)
  • v {{1|dayInWords|morph('Case=Loc')}}v pondělí (Czech)

date (En/Cs)

Formats date and time according to a format string.

Input: date/time in ISO format (or other format parsable by the arrow library) or 'NOW' which is equivalent to sending the current date in YYYY-MM-DD format.

Arguments:

  • position 1: output format. The syntax of the format string is documented in the arrow library documentation

Examples:

  • {{'2020-07-03T17:01:54'|date('D. M. YYYY H:mm:ss')}}3. 7. 2020 17:01:54
  • {{'2020-07-03'|date('D. MMMM YYYY')}}3. červenec 2020 (Czech)
  • {{'2020-07-03'|date('D MMMM YYYY')}}3 July 2020 (English)
  • {{'2020-07-03'|date('dddd, D. MMMM')}}pátek, 3. červenec (Czech)
  • {{'2020-07-03'|date('dddd, MMMM D')}}Friday, July 3 (English)

locdate (Cs)

Formats date and time without the need to provide a format string and with more local morphological customization.

Input: date/time in ISO format (or other format parsable by the arrow library) or 'NOW' which is equivalent to sending the current date in YYYY-MM-DD format.

Arguments:

  • monthName: should the month be written in words instead of digits
  • dayOfWeek: should the output date representation be preceded by day in week (in words)
  • noYear: should the output date NOT contain year
  • prep: abstract preposition used with the date expression. The preposition expresses the function of the date expression (point in time, period, since, ...) and does not always have to be realized as a preposition. Currently, the only supported prepositions are: v, do, od, k, z.

Examples:

  • {{'2020-07-03T07:51:54'|locdate}}3. 7. 2020 7:51:54
  • {{'2020-07-03T07:51:54'|locdate(monthName=True)}}3. července 2020 7:51:54
  • {{'2020-07-03'|locdate(monthName=True)}}3. července 2020
  • {{'2020-07-03'|locdate(monthName=True, noYear=True)}}3. července
  • {{'2020-07'|locdate(monthName=True)}}červenec 2020

The prepositions "v" is used to express that something happened in a particular time (it is realized as v + accusative, v + locative or a bare genitive):

  • {{'2020-07-30'|locdate(monthName=True, prep='v', dayOfWeek=True)}}ve čtvrtek 30. července 2020
  • {{'2020-07-30'|locdate(monthName=True, prep='v')}}30. července 2020
  • {{'2020-07'|locdate(monthName=True, prep='v')}}v červenci 2020
  • {{'2020'|locdate(prep='v')}}v roce 2020