# HG changeset patch # User Ludovic Chabant # Date 1438238822 25200 # Node ID 7df0a959791c317e719e5cca55537ccfabdcefbe # Parent 119ac8018964e779989a93f691db3d1cee1bb09f templating: Make more date functions accept 'now' as an input. diff -r 119ac8018964 -r 7df0a959791c piecrust/templating/jinjaengine.py --- a/piecrust/templating/jinjaengine.py Wed Jul 29 09:14:02 2015 -0700 +++ b/piecrust/templating/jinjaengine.py Wed Jul 29 23:47:02 2015 -0700 @@ -311,10 +311,14 @@ def get_xml_date(value): + if value == 'now': + value = time.time() return strict_rfc3339.timestamp_to_rfc3339_localoffset(int(value)) def get_email_date(value, localtime=False): + if value == 'now': + value = time.time() return email.utils.formatdate(value, localtime=localtime)