Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatefilters.py @ 17755:bededd3f0735
templatefilters: avoid traceback caused by bogus date input (issue3344)
Wrap datefilters which split date texts with util.parsedate.
We do not abort, as the bogus date must have been given by the user.
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Fri, 10 Aug 2012 20:37:20 +0100 |
parents | d42cc3c880b6 |
children | 823a7d79ef82 |
line wrap: on
line diff
--- a/mercurial/templatefilters.py Mon Aug 13 22:42:10 2012 +0200 +++ b/mercurial/templatefilters.py Fri Aug 10 20:37:20 2012 +0100 @@ -221,7 +221,7 @@ def localdate(text): """:localdate: Date. Converts a date to local date.""" - return (text[0], util.makedate()[1]) + return (util.parsedate(text)[0], util.makedate()[1]) def nonempty(str): """:nonempty: Any text. Returns '(none)' if the string is empty."""