moksha/lib/helpers.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 7f42530b1e14798edb1eb8b7e0ef725555e433e4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri May 29 13:08:02 2009 -0400
Make the DateTimeDisplay handle time.struct_time objects as well
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py
index fa1ff83..19e7587 100644
--- a/moksha/lib/helpers.py
+++ b/moksha/lib/helpers.py
@@ -951,6 +951,8 @@ class DateTimeDisplay(object):
self.timestamp = timestamp
if isinstance(timestamp, datetime):
self.datetime = timestamp
+ elif isinstance(timestamp, time.struct_time):
+ self.datetime = datetime(*timestamp[:-2])
elif isinstance(timestamp, basestring):
if hasattr(datetime, 'strptime'): # Python 2.5+
self.datetime = datetime.strptime(timestamp, format)
Show replies by date