# HG changeset patch # User Vadim Gelfer # Date 2006-02-27 20:50:49 # Node ID 9dec2479622d844305efa5ecd739fcd1ac102c33 # Parent 0c760737b9960d535264a2c296a9e724d1f76fdb add iso date template filter. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -144,6 +144,9 @@ def age(x): if n >= 2 or s == 1: return fmt(t, n) +def isodate(date): + return util.datestr(date, format='%Y-%m-%d %H:%M') + def nl2br(text): return text.replace('\n', '
\n') @@ -170,6 +173,7 @@ common_filters = { "domain": domain, "escape": lambda x: cgi.escape(x, True), "firstline": (lambda x: x.splitlines(1)[0]), + "isodate": isodate, "obfuscate": obfuscate, "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"), "person": person,