Branch: Tag:

2010-03-02

2010-03-02 11:50:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

month_from_yday() still needs to handle negative year days.
Fixes [bug 5303].

Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.13

88:   protected array(int) month_from_yday(int y,int yd)   {   // [month,day-of-month,ndays,month-year-day] -  if (yd >= 1) { +  while (yd <= 0) { +  yd += 365 + year_leap_year(--y); +  }    int l=year_leap_year(y);    if (yd<32) return ({1,yd,31,1});    yd-=l;
106:    case 305..334: return ({11,yd-304,30,305+l});    case 335..365: return ({12,yd-334,31,335+l});    } -  } +     error("yday out of range.\n");   }