a20af62000-09-26Fredrik Hübinette (Hubbe) #pike __VERSION__ inherit Calendar.Gregorian;
ac87a71998-01-19Marcus Comstedt 
a20af62000-09-26Fredrik Hübinette (Hubbe) class Year
ac87a71998-01-19Marcus Comstedt {
a20af62000-09-26Fredrik Hübinette (Hubbe)  inherit Calendar.Gregorian.Year; int julian_day(int d) // jd%7 gives weekday, mon=0, sun=6 { return 1721424 + d + (36525*(y-1))/100; }
ac87a71998-01-19Marcus Comstedt 
a20af62000-09-26Fredrik Hübinette (Hubbe)  int leap() { return !(y%4); }
ac87a71998-01-19Marcus Comstedt 
78fd532000-07-12Mirar (Pontus Hagland) }
a20af62000-09-26Fredrik Hübinette (Hubbe) class Day
78fd532000-07-12Mirar (Pontus Hagland) {
a20af62000-09-26Fredrik Hübinette (Hubbe)  inherit Calendar.Gregorian.Day; void create(int ... arg) { if (!sizeof(arg)) { int jd = Calendar.Gregorian.Day()->julian_day()-1721424; y = jd*100/36525+1; d = jd-(y-1)*36525/100; } else ::create(@arg); }
ac87a71998-01-19Marcus Comstedt }