diff piecrust/templating/jinjaengine.py @ 537:7df0a959791c

templating: Make more date functions accept 'now' as an input.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 29 Jul 2015 23:47:02 -0700
parents 63ae5eae90ca
children cbd5cdec0695
line wrap: on
line diff
--- 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)