You are here: Foswiki>Tasks Web>Item1547 (12 Dec 2017, GeorgeClark)Edit Attach

Item1547: CalendarPlugin wishlist: ISO dates as input

pencil
Priority: Enhancement
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: CalendarPlugin
Branches:
Reported By: MarcSCHAEFER
Waiting For:
Last Change By: GeorgeClark
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;

ItemTemplate edit

Summary CalendarPlugin wishlist: ISO dates as input
ReportedBy MarcSCHAEFER
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component CalendarPlugin
Priority Enhancement
CurrentState Needs Developer
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r2 - 12 Dec 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy