changeset 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 105f24f490cb
children 7e44f6092a1d
files piecrust/templating/jinjaengine.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
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))