diff rhodecode/lib/helpers.py @ 2445:9b623dcddb02 beta

Format datetime in notifications according to unified function
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 11 Jun 2012 23:23:32 +0200
parents f467c75544af
children 4753a3445ff7
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Sun Jun 10 18:18:30 2012 +0200
+++ b/rhodecode/lib/helpers.py	Mon Jun 11 23:23:32 2012 +0200
@@ -44,6 +44,7 @@
 from rhodecode.lib.markup_renderer import MarkupRenderer
 from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError
 from rhodecode.lib.vcs.backends.base import BaseChangeset
+from rhodecode.config.conf import DATE_FORMAT, DATETIME_FORMAT
 from rhodecode.model.db import URL_SEP
 
 log = logging.getLogger(__name__)
@@ -350,8 +351,8 @@
 
 def fmt_date(date):
     if date:
-        return (date.strftime(_(u"%a, %d %b %Y %H:%M:%S").encode('utf8'))
-            .decode('utf8'))
+        _fmt = _(u"%a, %d %b %Y %H:%M:%S").encode('utf8')
+        return date.strftime(_fmt).decode('utf8')
 
     return ""