pike.git / lib / modules / Calendar.pmod / Gregorian.pmod

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Gregorian.pmod:87:    case 11: return ({y,m,30,305+year_leap_year(y)});    case 12: return ({y,m,31,335+year_leap_year(y)});    }       error("month out of range\n");   }      static array(int) month_from_yday(int y,int yd)   {   // [month,day-of-month,ndays,month-year-day] +  if (yd<1) return ({12,31+yd,32,335+year_leap_year(y-1)});    int l=year_leap_year(y);    if (yd<32) return ({1,yd,31,1});    yd-=l;    switch (yd)    {    case 0..59: return ({2,yd-31+l,28+l,32});    case 60..90: return ({3,yd-59,31 ,60+year_leap_year(y)});    case 91..120: return ({4,yd-90,30 ,91+year_leap_year(y)});    case 121..151: return ({5,yd-120,31 ,121+year_leap_year(y)});    case 152..181: return ({6,yd-151,30 ,152+year_leap_year(y)});