[Moin-user] relative time macro

Tyler Oderkirk tyle.roderkirk at gmail.com
Thu Mar 25 00:31:57 EDT 2010


On Wed, Mar 24, 2010 at 2:25 AM, MSulchan Darmawan <bleketux at gmail.com> wrote:
> Something like this maybe :
> [[RelativeTime(2010-03-23T22:49:23Z)]]
>
> with result :
> 1 day ago

Hello Sulchan,

I'm not aware of a ready-made macro that fits your needs. If you want
to write your own here is a starting point:

In Moinmoin 1.9 you can find the relevant code from the RecentChanges
macro at http://hg.moinmo.in/moin/1.9/file/ced05deb11ae/MoinMoin/macro/RecentChanges.py#l98
It illustrates calculating and formatting the "difference" between two
dates in Python.

-Tyler

-- 
"Injustice is relatively easy to bear; what stings is justice."
     - H.L. Mencken




More information about the Moin-user mailing list