Ignore:
Timestamp:
27 Feb 2015, 21:56:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Show validity period on contract pages and slips.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/helpers.py

    r12408 r12634  
    3030from cStringIO import StringIO
    3131from docutils.core import publish_string
     32from zope.i18n import translate
    3233from zope.component import getUtility
    3334from zope.component.interfaces import IFactory
     
    4041from zope.pluggableauth.interfaces import IAuthenticatorPlugin
    4142from zope.formlib.widget import renderElement
     43from waeup.ikoba.interfaces import MessageFactory as _
    4244
    4345BUFSIZE = 8 * 1024
     
    859861                contents=ReST2HTML(text))
    860862    return elements
     863
     864def format_date(dateobj, request):
     865    if isinstance(dateobj, datetime.date):
     866        return dateobj.strftime("%d/%m/%Y")
     867    else:
     868        return translate(_('indefinite'), context=request)
Note: See TracChangeset for help on using the changeset viewer.