Branch: Tag:

2000-10-26

2000-10-26 15:23:47 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

added Events.tzshift, a mechanism to figure out when a timezone shifts

Rev: lib/modules/Calendar.pmod/Event.pmod:1.10
Rev: lib/modules/Calendar.pmod/Events.pmod:1.7
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.14

642:    array sr=({});       int mn=min(@indices(rules-(<NUL_YEAR>))); +  int firstyear=99999,lastyear=0;       for (y=INF_YEAR;sizeof(r2);y--)    if (r2[y])
659:       int y0=min(@(array)my);    int y2=max(@(array)my); +  if (y0!=NUL_YEAR && y0<firstyear) firstyear=y0; +  if (y2!=INF_YEAR && y2>lastyear) lastyear=y2;    for (; y0<=y2; y0++)    if (my[y0])    {
667:       y1--;    +  // figure first and last interesting year    if (y0==NUL_YEAR)    { -  +  if (y1!=NUL_YEAR && y1<firstyear) firstyear=y1;    if (my[INF_YEAR])    tr+=({" default: // .."+max(y1,mn-1),    " and ½½½..\n"});
678:    }    else if (y0==y1)    tr+=({" case "+y0+":\n"}); -  else if (y1==2050) +  else if (y1==INF_YEAR)    { -  +  if (y0>lastyear) lastyear=y0; +     if (!my[NUL_YEAR])    tr+=({" case "+y0,"..:\n"});    else
705:    ({" }\n"    " }\n"    "\n" +  "constant firstyear="+firstyear+";\n" +  "constant lastyear="+lastyear+";\n",    "array(string) rule_s=\n"});       multiset tzname=(<>);
1133:    if (sscanf(line,"Rule%*[ \t]%[^ \t]%*[ \t]%s",a,b)==4 &&    a==s)    r->add(b); -  else +  else if (sscanf(line,"%*[ ]#%*s")<2)    break; // end of zone   #ifdef RTTZC_TIMING    float tf=time(t);