Roundup Tracker - Issues

Message5322

Author antmail
Recipients antmail
Date 2015-06-18.11:31:28
Message-id <1434627088.84.0.198898207253.issue2550889@psf.upfronthosting.co.za>
In-reply-to
Outputing period (duration) from a template seems to be rather complex.
Also, 'pretty' format with words 'ago', 'in' may be a problem for
outputing duration only .

I create some functions for simplifying this task:
HTMLDate
def periodof(self, pretty=1, othdate='.'):
    """ Render the duration between this date and other date (default is
now). If the "pretty" flag is true, then make the display human readable."""

Interval
def period()
# return interval in human readable format such as "1 month", "2 week" etc.

Use it in templates as:
issue.closedate.periodof(othdate = issue.creation)
History
Date User Action Args
2015-06-18 11:31:28antmailsetrecipients: + antmail
2015-06-18 11:31:28antmailsetmessageid: <1434627088.84.0.198898207253.issue2550889@psf.upfronthosting.co.za>
2015-06-18 11:31:28antmaillinkissue2550889 messages
2015-06-18 11:31:28antmailcreate