format time for comments with python strftime(). no time localization so far.

svn path=/plone.app.discussion/trunk/; revision=27231
This commit is contained in:
Timo Stollenwerk 2009-05-31 11:01:36 +00:00
parent 0ce270bc66
commit 0d6045682f

View File

@ -74,7 +74,10 @@ class CommentsViewlet(ViewletBase):
return '%s/login_form?came_from=%s' % (self.navigation_root_url, url_quote(self.request.get('URL', '')),) return '%s/login_form?came_from=%s' % (self.navigation_root_url, url_quote(self.request.get('URL', '')),)
def format_time(self, time): def format_time(self, time):
return self.context.restrictedTraverse('@@plone').toLocalizedTime(time, long_format=True) # Todo: return localized time
return time.strftime("%a, %d %b %Y %H:%M")
# XXX: Not working, returns None !!!
#return self.context.restrictedTraverse('@@plone').toLocalizedTime(time, long_format=True)
class AddComment(BrowserView): class AddComment(BrowserView):
"""Add a comment to a conversation """Add a comment to a conversation