[pmwiki-users] Page text variable arithmetic

Patrick R. Michaud pmichaud at pobox.com
Wed Aug 29 14:16:27 CDT 2007


On Wed, Aug 29, 2007 at 04:07:01PM -0300, Guillermo Calderon - INCO wrote:
> Steve Glover wrote:
> > Hi,
> > 
> > Is there a way, please, of carrying out either arithmetic or comparisons
> > when creating a PTV?
> > 
> > I have {(ftime fmt="%Y%m%d" when="{$Title}")} which gets the date string
> > from my page name as yyyymmdd and {(ftime fmt="%Y%m%d" when="{$Today}")}
> > which gets today's date in the same format, and I'd like to be able to
> > create a variable that will indicate if page dates are past, present or
> > future.
> > 
> 
> Maybe you can achieve thiat with conditional markup:  (:if date .... :)
> Take a look at
> 
>        http://www.pmwiki.org/wiki/PmWiki/ConditionalMarkup


Perhaps:

    (:if date today        "{$Title}"  :)  title is today
    (:if date tomorrow..   "{$Title}"  :)  title is after today
    (:if date ..yesterday  "{$Title}"  :)  title is before today

Pm



More information about the pmwiki-users mailing list