Can someone with access patch this?
Index: Events.pmod =================================================================== RCS file: /pike/data/cvsroot/Pike/7.7/lib/modules/Calendar.pmod/Events.pmod,v retrieving revision 1.15 diff -u -r1.15 Events.pmod --- Events.pmod 7 Aug 2003 14:19:44 -0000 1.15 +++ Events.pmod 2 Jan 2007 17:15:22 -0000 @@ -67,9 +67,10 @@
case "WDRel": // WDRel May Fri 1st + days=1; if (sscanf(rule, "WDRel%*[ \t]%s%*[ \t]%s%*[ \t]%d%*[a-z]%*[ \t]%d days", - mn,wd,n,days)>=5 && + mn,wd,n,days)>=7 && month2n[mn] && wd2n[wd] && n>0) { Event.Event e= @@ -79,9 +80,10 @@ return e; } // WDRel May Fri last + days=1; if (sscanf(rule, "WDRel%*[ \t]%s%*[ \t]%s%*[ \t]%s%*[ \t]%d days", - mn,wd,a,days)>=5 && a=="last" && + mn,wd,a,days)>=6 && a=="last" && (m=month2n[mn]) && wd2n[wd]) { m=(m%12)+1; @@ -92,11 +94,12 @@ return e; } // WDRel May 17 Fri +17 excl - days=a=0; + a=0; + days=1; if (sscanf(rule, "WDRel%*[ \t]%[A-z]%*[ \t]%d%*[ \t]%s%*[ \t]" "%d%*[ \t]%[a-z]%*[ \t]%d days", - mn,md,wd,n,a,days)>=9 && a && a!="" && + mn,md,wd,n,a,days)>=10 && a && a!="" && (m=month2n[mn]) && wd2n[wd]) { if (!(<"incl","excl">)[a]) @@ -111,10 +114,11 @@ return e; } // WDRel May 17 Fri +17 + days=1; if (sscanf(rule, "WDRel%*[ \t]%[A-z]%*[ \t]%d%*[ \t]%[^ \t]%*[ \t]" "%d%*[ \t]%d days", - mn,md,wd,n,days)>=7 && + mn,md,wd,n,days)>=8 && (m=month2n[mn]) && wd2n[wd]) { m=(m%12)+1;
/ Mirar
Previous text:
15109614 2007-01-02 18:14 /14 lines/ Mirar Recipients: Tideräkning (och) kalendrar Comment to 15109518 Subject: Arbetsdagar på ett år
Vilka icke-helgdagar är icke-arbetsdagar? Lördagar, julafton, nyårsafton och midsommarafton, eller är de fler?
Då får jag 11337 helgdagar (efter bugfix) mellan 2000 och 2099, dvs 25188 arbetsdagar = 251.88 arbetsdagar per år. En miss på 0.7, vad har jag missat?
(för den som är intresserad, Pike: sizeof((Calendar.Events.se->holidays() |Calendar.Events.saturday |Calendar.Events.se["christmas eve"] |Calendar.Events["new years eve"] |Calendar.Events.se["midsummers eve"] ->scan_events((Calendar.Year(2000)*100))); )
(15109614) /Mirar/--------------------------------------------------
No, but you can use this test:
object k=Calendar.Events.se["midsummers eve"]->next(Calendar.Year()); k->second(1)!=k->second(2);
The problem was/is that many (all?) WDRel events was regarded as 0 days long, due to the wrong constant used in combination with sscanf in the patched code.
pike-devel@lists.lysator.liu.se