plone.app.event.browser.formatted_date — plone.app.event 1.0dev documentation

### Navigation

- index
- modules |
- plone.app.event 1.0dev documentation »
- Module code »

# Source code for plone.app.event.browser.formatted_date

    from Acquisition import Explicit
    from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
    from plone.app.event.base import dates_for_display

    class FormattedDateProvider(Explicit):
        template = ViewPageTemplateFile(u'formatted_date.pt')

        def __init__(self, context, request, view):
            self.__parent__ = view
            self.context = context
            self.request = request

        def __call__(self, occ):
            """Return a formatted date string.

            :param occ: An event or occurrence.
            :type occ: IEvent or IOccurrence
            :returns: Formatted date string for display.
            :rtype: string

            """
            self.date_dict = dates_for_display(occ)
            return self.template(self)

    class FormattedStartDateProvider(FormattedDateProvider):
        template = ViewPageTemplateFile(u'formatted_start_date.pt')

### Navigation

- index
- modules |
- plone.app.event 1.0dev documentation »
- Module code »