Add filters to your data
Thomas van Beek avatar
Written by Thomas van Beek
Updated over a week ago

It's possible to add filters to your data tags to manipulate or stylize your data to your liking. You can use filters by adding the following code to your data tag:

Without filter:

{{ data.tag }}

With filter:

{{ data.tag | filter_name }}


We currently have the following filters available:

Format Money

format_money - Formats a numeric amount to money notation.

{{ event.fee | format_money }}
Output: 1,500.00

Format Percentage

format_percentage - Formats a numeric amount to percentage notation, this will remove the decimals from the number.

{{ event.vat_percentage | format_percentage }}
Output: 21

Upcase

upcase - Transforms text to all upercase.

{{ event.title | upcase }}
Output: WOODSTOCK

Date

date: "format" - Formats a date to your prefered structure. You can specify your desired structure in the "format" section.

{{ event.start | date: "%B %d, %Y" }}
Output: April 16, 2017

Dates
%a  - The abbreviated weekday name ("Sun")
%A  - The full weekday name ("Sunday")
%b  - The abbreviated month name ("Jan")
%B  - The full month name ("January")
%d  - Day of the month (01..31)
%e  - Day of the month without a leading zero (1..31)
%j  - Day of the year (001..366)
%m  - Month of the year (01..12)
%U  - Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
%W  - Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
%w  - Day of the week (Sunday is 0, 0..6)
%x  - Preferred representation for the date alone, no time
%y  - Year without a century (00..99)
%Y  - Year with century

Times
%H  - Hour of the day, 24-hour clock (00..23)
%I  - Hour of the day, 12-hour clock (01..12)
%l  - Hour of the day, 12-hour clock without a leading zero (1..12)
%M  - Minute of the hour (00..59)
%P  - Meridian indicator ("am" or "pm")
%p  - Meridian indicator ("AM" or "PM")
%S  - Second of the minute (00..60)
%X  - Preferred representation for the time alone, no date
%Z  - Time zone name

Did this answer your question?