Mercurial > piecrust2
diff piecrust/templating/jinjaengine.py @ 356:019d274e6713
data: Also expose XML date formatting as `xmldate` in Jinja.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 20 Apr 2015 22:34:49 -0700 |
parents | 498a917cd2d4 |
children | 9e25852f058b |
line wrap: on
line diff
--- a/piecrust/templating/jinjaengine.py Mon Apr 20 22:34:15 2015 -0700 +++ b/piecrust/templating/jinjaengine.py Mon Apr 20 22:34:49 2015 -0700 @@ -149,7 +149,8 @@ 'stripoutertag': strip_outer_tag, 'stripslash': strip_slash, 'titlecase': title_case, - 'atomdate': get_atom_date, + 'atomdate': get_xml_date, + 'xmldate': get_xml_date, 'emaildate': get_email_date, 'date': get_date}) @@ -237,7 +238,7 @@ return value.title() -def get_atom_date(value): +def get_xml_date(value): return strict_rfc3339.timestamp_to_rfc3339_localoffset(int(value))