Ignore:
Timestamp:
3 Dec 2011, 05:09:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Define formatDatetime (for displaying datetime objects in data tables) centrally in layout.py.

File:
1 edited

Legend:

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

    r7243 r7254  
    2020import os
    2121import grok
     22from datetime import date, datetime
    2223import grokcore.view
    2324from hurry.resource import mode
     
    202203        return
    203204
     205    def formatDatetime(self,datetimeobj):
     206        if isinstance(datetimeobj, datetime):
     207            return datetimeobj.strftime("%Y-%m-%d %H:%M:%S")
     208        else:
     209            return None
     210
    204211    def update(self):
    205212        """Include the resources required by the chosen skin/theme.
Note: See TracChangeset for help on using the changeset viewer.