[pmwiki-users] Conditional Directive based on time - standards

Patrick R. Michaud pmichaud at pobox.com
Thu Oct 13 10:04:33 CDT 2005


On Thu, Oct 13, 2005 at 07:57:28PM +1300, Simon wrote:
>    http://www.cl.cam.ac.uk/~mgk25/iso-time.html ISO 8601 is useful.
> 
>    I suggest that dates be formatted yyyy-mm-dd
>    and could we also allow times, eg hh:mm    (24 hour time of course)

AFAIK, both of the existing calendar recipes (PmCal and WikiCalendar)
produces page names in the form yyyymmdd, so I think we ought to
stick with that format, or at least make sure it's allowed.  In 
particular, it might be nice to be able to write something like

    (:if date {$Name}:) Today's events: (:if:)

so that "Today's events" only displays on the page corresponding to
the current date.

However, I don't have a problem with setting the date code to
ignore non-digit characters altogether, so that one can write any
of 20051014, 2005-10-14, 2005/10/14, or 2005.10.14 and have things
work out correctly.

To be consistent with the (:include:) markup, I'm also thinking that
we should specify ranges with "..", thus

    (:if date 20051014..20051020:)    Oct 14 through Oct 20
    (:if date 20051014..:)            On or after Oct 14
    (:if date ..20051020:)            On or before Oct 20

I'm not yet a big fan of the "before", "after", "future", "past",
"between", etc. keywords--I don't think they're obvious on their
face and still require explanation.  (We can always add keyword-based
times later if we decide we need them.)

I like offset dates--i.e.,  "+30days", "+2months", "+1year",
but they may be left for the second iteration of the code.
The interpretation of something like "20051005..+10days"
should probably be "ten days starting with Oct 5", thus "Oct 5
through Oct 14".

I doubt we'll have "today", "tomorrow", etc. substitutions for
a while -- they may just cause too much confusion.  

I'm still on the fence about truncated dates and allowing time
specifiers.  It's not an implementation problem, but enough people
have said that they'd like dates-always-in-one-format that
I'm reluctant to include the extended forms by default.  Perhaps it 
will be an option for the wikiadmin, or maybe a different (:if:) 
condition name that says the extra date/time formats are okay.

    (:if date_t 200510..2006:)         # 2005-Oct-01 through 2006-Dec-31
    (:if date_t ..2005-10-13T12:00 :)   # until noon on 2005-Oct-13

Pm




More information about the pmwiki-users mailing list