diff piecrust/templating/jinjaengine.py @ 28:19f3ac27c3d5

The `date` filter now supports passing `"now"` as in Twig.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 19 Aug 2014 11:50:51 -0700
parents dc72a288921f
children 1a30e3d7ee47
line wrap: on
line diff
--- a/piecrust/templating/jinjaengine.py	Tue Aug 19 11:50:21 2014 -0700
+++ b/piecrust/templating/jinjaengine.py	Tue Aug 19 11:50:51 2014 -0700
@@ -166,6 +166,8 @@
 
 
 def get_date(value, fmt):
+    if value == 'now':
+        value = time.time()
     return time.strftime(fmt, time.localtime(value))