X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/ed88d219d74ed9e63442b420d52fea394277eacf..b4471d44184a03180ad19a98673d52752ce73b46:/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn diff --git a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn index 2d14c827d..4bc828e6e 100644 --- a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn +++ b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn @@ -1,4 +1,4 @@ -[[tag patch]] +[[!tag patch plugins/calendar]] Here's my next version of the patch - still a work in progress. @@ -6,7 +6,7 @@ It provides the following new features. The features are designed to preserve th * If you specify an event preprocessor in a post, such as: - [[event time="2008-06-24"]] + [[!event time="2008-06-24"]] That date will be used instead of the post creation time when displaying the calendar. @@ -42,13 +42,13 @@ Longer term plans: my %cache; my %linkcache; @@ -32,6 +34,7 @@ - sub import { #{{{ + sub import { hook(type => "needsbuild", id => "version", call => \&needsbuild); hook(type => "preprocess", id => "calendar", call => \&preprocess); + hook(type => "preprocess", id => "event", call => \&preprocess_event); - } #}}} + } - sub is_leap_year (@) { #{{{ + sub is_leap_year (@) { @@ -58,6 +61,7 @@ my $nmonth = $params{nmonth}; my $pyear = $params{pyear}; @@ -137,9 +137,9 @@ Longer term plans: # finish off the week @@ -304,6 +333,18 @@ return $calendar; - } #}}} + } - +sub preprocess_event (@) { #{{{ + +sub preprocess_event (@) { + my %params=@_; + # if now time is given, use now + $params{begin} = localtime($time) unless defined $params{begin}; @@ -151,7 +151,7 @@ Longer term plans: + return ""; +} #}} + - sub preprocess (@) { #{{{ + sub preprocess (@) { my %params=@_; $params{pages} = "*" unless defined $params{pages}; @@ -311,6 +352,8 @@