Changeset 8195


Ignore:
Timestamp:
17 Apr 2012, 11:57:49 (13 years ago)
Author:
Henrik Bettermann
Message:

Localize time in tables too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py

    r8106 r8195  
    3333from zope.interface import Interface
    3434from zope.site.hooks import getSite
    35 from waeup.kofa.interfaces import IKofaObject, IUserAccount
     35from waeup.kofa.interfaces import IKofaObject, IUserAccount, IKofaUtils
     36from waeup.kofa.utils.helpers import to_timezone
    3637from waeup.kofa.browser.interfaces import ITheme
    3738from waeup.kofa.browser.theming import get_all_themes, KofaThemeBase
     
    289290    def formatDatetime(self,datetimeobj):
    290291        if isinstance(datetimeobj, datetime):
    291             return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
     292            tz = getUtility(IKofaUtils).tzinfo
     293            timestamp = to_timezone(
     294                datetimeobj, tz).strftime("%Y-%m-%d %H:%M:%S")
     295            return timestamp
    292296        else:
    293297            return None
Note: See TracChangeset for help on using the changeset viewer.