Mercurial > hg-stable
changeset 1906:9dec2479622d
add iso date template filter.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 27 Feb 2006 12:50:49 -0800 |
parents | 0c760737b996 |
children | 7718885070b1 |
files | mercurial/templater.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templater.py Mon Feb 27 12:41:20 2006 -0800 +++ b/mercurial/templater.py Mon Feb 27 12:50:49 2006 -0800 @@ -144,6 +144,9 @@ 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', '<br/>\n') @@ -170,6 +173,7 @@ "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,