[Mpuls-commits] r1870 - wasko/branches/2.0/mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Mar 1 11:03:57 CET 2010
Author: torsten
Date: 2010-03-01 11:03:56 +0100 (Mon, 01 Mar 2010)
New Revision: 1870
Modified:
wasko/branches/2.0/mpulsweb/lib/helpers.py
Log:
* mpulsweb/lib/helpers.py (format_date), (format_time),
(format_datetime): Unicode handling in strftime-functions in
lib/helpers
Modified: wasko/branches/2.0/mpulsweb/lib/helpers.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/helpers.py 2010-03-01 08:03:28 UTC (rev 1869)
+++ wasko/branches/2.0/mpulsweb/lib/helpers.py 2010-03-01 10:03:56 UTC (rev 1870)
@@ -143,7 +143,8 @@
if dt is None:
return ''
try:
- return dt.strftime(locale.nl_langinfo(locale.D_FMT))
+ cs = locale.nl_langinfo(locale.CODESET)
+ return unicode(dt.strftime(locale.nl_langinfo(locale.D_FMT)), cs)
except Exception, err:
log.error(err)
return dd_mm_YYYY(dt)
@@ -152,7 +153,8 @@
if dt is None:
return ''
try:
- return dt.strftime(locale.nl_langinfo(locale.T_FMT))
+ cs = locale.nl_langinfo(locale.CODESET)
+ return unicode(dt.strftime(locale.nl_langinfo(locale.T_FMT)), cs)
except Exception, err:
log.error(err)
return ''
@@ -161,7 +163,9 @@
if dt is None:
return ''
try:
- return dt.strftime(locale.nl_langinfo(locale.D_T_FMT))
+ t = dt.strftime(locale.nl_langinfo(locale.D_T_FMT))
+ cs = locale.nl_langinfo(locale.CODESET)
+ return unicode(dt.strftime(locale.nl_langinfo(locale.D_T_FMT)), cs)
except Exception, err:
log.error(err)
return dd_mm_yyyy_HH_MM(dt)
More information about the Mpuls-commits
mailing list