This plugin provides a family of pagespec matching pages according to creation or modification times.
It also sets the date of the next modification of the page on relevant date, so that the page will be rebuilt if the condition changes.
It requires the DateTime::Format::Duration perl module (on Debian :
apt-get install libdatetime-format-duration-perl).
List of functions
The list of functions is given by the following regexp:
[ct]: compare creation or modification time or date:
(date|time): compare full date and time, or only date (useful when time is irrelevant):
time: compare full date and time;
date: compare only date.
(lt|gt|leq|geq|eq|neq): operator of comparison:
lt: less than;
gt: greater than;
leq: less or equal than;
geq: greater or equal than;
neq: not equal.
(abs|page|now|today): element to compare to:
abs: absolute date or time (given in argument);
page: other page (given in argument);
now: date or time of compilation;
today: same meaning as
(|_delta): used to add a time delta (to use comparisons such as created at least two days after
- empty: no delta;
_delta: delta (given in argument).
Number of arguments
|no delta||no arguments||
Format of arguments
- date or time: anything that can be recognized by perl str2time function, without any comma.
- delta: One of the following patterns:
Y-M-D: positive date;
H:M:S: positive time;
Y-M-D H:M:S: positive date and time;
-at the beginning of the string to make durations negative.
- several arguments: when two arguments are provided, they are passed as one string, which is then split according to the last comma.
timezone in the setup file is used to define time zone. If not set, we
try to guess the local time zone.
ctime_gt_page(foo): match pages created after page
cdate_eq_today(): match pages created the day the wiki is compiled.
mtime_eq_now(): match pages modified the time the wiki is compiled (likely no page, since comparison is done up to the milisecond).
cdate_geq_page_delta(foo, 00-00-01): match pages created at least one day after page
cdate_gt_page(foo): same as the previous one.
mdate_gt_today_delta(-00-01-00): match pages modified one month ago, or later (can be used to display recent changes).
It can be used to display a list of upcoming events.
[[!inline pages="events/* and cdate_geq_today()" reverse=yes sorted=meta(date)]]
Code and documentation this way: https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/datetime_cmp.