changeset 271:4746df47a538

Follow on to last rev (r292) for #126. Missed updating a shoutbox template. Also the repoze.timeago package uses UTC time by default. Change this to local time for now until we decide to switch over to UTC for everything.
author Brian Neal <bgneal@gmail.com>
date Sun, 26 Sep 2010 17:42:00 +0000
parents 85f81377bb5b
children 4557974db0e0
files gpp/core/templatetags/core_tags.py gpp/templates/shoutbox/shout.html
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/core/templatetags/core_tags.py	Sun Sep 26 17:27:08 2010 +0000
+++ b/gpp/core/templatetags/core_tags.py	Sun Sep 26 17:42:00 2010 +0000
@@ -58,6 +58,10 @@
     return info
 
 
+# A somewhat ugly hack until we decide if we should be using UTC time
+# everywhere or not.
+repoze.timeago._NOW = datetime.datetime.now
+
 @register.filter(name='elapsed')
 def elapsed(timestamp):
     """
--- a/gpp/templates/shoutbox/shout.html	Sun Sep 26 17:27:08 2010 +0000
+++ b/gpp/templates/shoutbox/shout.html	Sun Sep 26 17:42:00 2010 +0000
@@ -1,5 +1,6 @@
+{% load core_tags %}
 <p style="display:none;">
 <span class="shoutbox-user">{{ shout.user.username }}:</span>
 <span class="shoutbox-shout">{{ shout.html|safe }}</span>
-<span class="shoutbox-date">{{ shout.shout_date|date:"D M d Y H:i:s" }}</span>
+<span class="shoutbox-date">{{ shout.shout_date|elapsed }}</span>
 </p>