diff mercurial/templatefilters.py @ 6134:7b937b26adf7

Make annotae/grep print short dates with -q/--quiet. Move shortdate() from templatefilters to util to avoid code duplication.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 16 Feb 2008 13:33:38 +0100
parents 9f1e6ab76069
children 434139080ed4
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Sat Feb 16 13:01:27 2008 +0100
+++ b/mercurial/templatefilters.py	Sat Feb 16 13:33:38 2008 +0100
@@ -100,10 +100,6 @@
     if f == -1: return util.shortuser(author)
     return author[:f].rstrip()
 
-def shortdate(date):
-    '''turn (timestamp, tzoff) tuple into iso 8631 date.'''
-    return util.datestr(date, format='%Y-%m-%d', timezone=False)
-
 def indent(text, prefix):
     '''indent each non-empty line of text after first with prefix.'''
     lines = text.splitlines()
@@ -145,7 +141,7 @@
     "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"),
     "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S", True, "%+03d:%02d"),
     "short": lambda x: x[:12],
-    "shortdate": shortdate,
+    "shortdate": util.shortdate,
     "stringify": templater.stringify,
     "strip": lambda x: x.strip(),
     "urlescape": lambda x: urllib.quote(x),