X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=blobdiff_plain;f=doc%2Ftodo%2FSet_arbitrary_date_to_be_used_by_calendar_plugin.mdwn;h=e0074eef8dcad4c23d7ce374fb5d918da9f2afdc;hp=a2643391927cfe399ad00a119dc5e25250b2f2b4;hb=fa9f023deb2d92ed478a0f476043d13d4eec739f;hpb=dd87d82fbe2bf09abe634caef044474d5b24502e 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 a26433919..e0074eef8 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,7 +1,9 @@ -[[!tag patch]] +[[!tag patch plugins/calendar]] Here's my next version of the patch - still a work in progress. + Note:I partially updated part of this patch to work on Ikiwiki v3 - see [here](http://ikiwiki.info/forum/Calendar:_listing_multiple_entries_per_day/) -- Matt Ford + It provides the following new features. The features are designed to preserve the behavior of the existing plugin by default. * If you specify an event preprocessor in a post, such as: @@ -42,13 +44,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 +139,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 +153,7 @@ Longer term plans: + return ""; +} #}} + - sub preprocess (@) { #{{{ + sub preprocess (@) { my %params=@_; $params{pages} = "*" unless defined $params{pages}; @@ -311,6 +352,8 @@