Message5322
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) |
|
Date |
User |
Action |
Args |
2015-06-18 11:31:28 | antmail | set | recipients:
+ antmail |
2015-06-18 11:31:28 | antmail | set | messageid: <1434627088.84.0.198898207253.issue2550889@psf.upfronthosting.co.za> |
2015-06-18 11:31:28 | antmail | link | issue2550889 messages |
2015-06-18 11:31:28 | antmail | create | |
|