# HG changeset patch # User Henrik Stuart # Date 1243158067 -7200 # Node ID 08c93b07f5ad9ac835b0785f838d915ee9197194 # Parent 59acb9c7d90f28e38a7ebaa0b8b7320fe7d710aa templatefilters: add filter to convert date to local date (issue1674) Issue1674 suggests the localdate filter be applied as default to log, but this patch only introduces the filter, not the changed default behaviour. diff -r 59acb9c7d90f -r 08c93b07f5ad mercurial/help.py --- a/mercurial/help.py Fri May 22 08:56:43 2009 +0200 +++ b/mercurial/help.py Sun May 24 11:41:07 2009 +0200 @@ -341,6 +341,7 @@ - hgdate: Date. Returns the date as a pair of numbers: "1157407993 25200" (Unix timestamp, timezone offset). - isodate: Date. Returns the date in ISO 8601 format. + - localdate: Date. Converts a date to local date. - obfuscate: Any text. Returns the input text rendered as a sequence of XML entities. - person: Any text. Returns the text before an email address. diff -r 59acb9c7d90f -r 08c93b07f5ad mercurial/templatefilters.py --- a/mercurial/templatefilters.py Fri May 22 08:56:43 2009 +0200 +++ b/mercurial/templatefilters.py Sun May 24 11:41:07 2009 +0200 @@ -192,6 +192,7 @@ "isodatesec": lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2'), "json": json, "jsonescape": jsonescape, + "localdate": lambda x: (x[0], util.makedate()[1]), "nonempty": nonempty, "obfuscate": obfuscate, "permissions": permissions,