Skip to content

Commit

Permalink
Document template filters (closes #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
TkTech committed Aug 27, 2020
1 parent 87630d1 commit e967b35
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ Example selector functions::
The example above assumes that the current user is stored on the
:data:`flask.g` object.

Jinja Filters
-------------

Several commonly used formatters are added as jinja template filters after
calling `init_app().` For dates and times, these are:

- `<datetime>|datetimeformat` -> `format_datetime`
- `<date>|dateformat` -> `format_date`
- `<time>|timeformat` -> `format_time`
- `<timedelta>|timedeltaformat` -> `format_timedelta`

And for numbers, these are:

- `<number>|numberformat` -> `format_number`
- `<number>|decimalformat` -> `format_decimal`
- `<number>|currencyformat` -> `format_currency`
- `<number>|percentformat` -> `format_percent`
- `<number>|scientificformat` -> `format_scientific`

Formatting Dates
----------------

Expand Down

0 comments on commit e967b35

Please sign in to comment.