Ignore:
Timestamp:
7 Aug 2012, 21:06:42 (12 years ago)
Author:
Henrik Bettermann
Message:

Take timezone into consideration when displaying the date only.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt

    r8388 r9088  
    2525      </td>
    2626      <td>
    27       <span tal:content="python: layout.formatDate(entry.startdate)">START</span>
     27      <span tal:content="python: layout.formatTZDate(entry.startdate)">START</span>
    2828      -
    29       <span tal:content="python: layout.formatDate(entry.enddate)">END</span>
     29      <span tal:content="python: layout.formatTZDate(entry.enddate)">END</span>
    3030      </td>
    3131    </tr>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py

    r9052 r9088  
    313313        else:
    314314            return None
     315           
     316    def formatTZDate(self,datetimeobj):
     317        if isinstance(datetimeobj, datetime):
     318            tz = getUtility(IKofaUtils).tzinfo
     319            date = to_timezone(
     320                datetimeobj, tz).strftime("%d/%m/%Y")
     321            return date
     322        else:
     323            return None         
    315324
    316325    def update(self):
Note: See TracChangeset for help on using the changeset viewer.