Priority: Enhancement
Current State: Needs Developer
Released In: n/a
Target Release: n/a
I find it handy to be able to have ISO-9660 dates (at least YYYY-MM-DD) in
CalendarPlugin
--- ./lib/Foswiki/Plugins/CalendarPlugin.pm-2009-04-29 2009-04-29 18:56:18.000000000 +0000
+++ ./lib/Foswiki/Plugins/CalendarPlugin.pm 2009-04-29 18:58:31.000000000 +0000
@@ -556,6 +556,7 @@
local $weekly_rx = "E\\s+($wdays_rx)";
local $periodic_rx = "E([0-9]+)\\s+$full_date_rx";
local $numdaymon_rx = "([0-9L])\\s+($wdays_rx)\\s+($months_rx)";
+ local $iso_8601 = "\\s*(\\d\\d\\d\\d)\\-(\\d\\d)\\-(\\d\\d)\\s*";
# Keep only bullet lines from the text. Note that this is done
# inside the loop because as each pattern is matched by
@@ -566,6 +567,22 @@
my @bullets = grep { /^\s+\*/ } split( /[\n\r]+/, $text );
+ # collect standard dates (ISO-8601)
+ @days = fetchDays($iso_8601, \@bullets);
+ foreach $d (@days) {
+ ($yy, $mm, $dd, $xs, $xcstr, $descr) = split(/\|/, $d);
+ eval {
+ # hack
+ $mm += 0;
+ $dd += 0;
+
+ if ($yy == $y && $mm == $m) {
+ &highlightDay( $cal, $dd, $descr, %options);
+ }
+ };
+ &Foswiki::Func::writeWarning( "$pluginName: $@ " ) if $@ && $debug;
+ }
+
# collect all date intervals with year
@days = fetchDays( "$full_date_rx\\s+-\\s+$full_date_rx", \@bullets );
$multidaycounter = 0;