Branch: Tag:

2003-02-11

2003-02-11 15:59:58 by Johan Sundström <oyasumi@gmail.com>

Somewhat kludgy fix to make the Calendar format functions report the correct start date for certain boundary case weeks.

Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.7
Rev: lib/modules/Calendar.pmod/YMD.pmod:1.49
Rev: lib/modules/Calendar.pmod/testsuite.in:1.6

399:    if (m==CALUNKNOWN) make_month();    if (w==CALUNKNOWN) make_week();    return sprintf("%04d-%02d-%02d (%s) -W%02d-%d (%s)", -  y,m,md, +  ((yd < 1)?y-1:y),m,md,    month_shortname(),    w,wd, // fixme - what weekday?    week_day_shortname());
432:    ("SunMonTueWedThuFriSat"/3)[compat_week_day(wd)],    md,    ("zzzJanFebMarAprMayJunJulAugSepOctNovDec"/3)[m], -  y); +  ((yd < 1)?y-1:y));    }       string format_ymd()    {    if (m==CALUNKNOWN) make_month(); -  return sprintf("%04d-%02d-%02d",y,m,md); +  return sprintf("%04d-%02d-%02d",((yd < 1)?y-1:y),m,md);    }       string format_ymd_short()    {    if (m==CALUNKNOWN) make_month(); -  return sprintf("%04d%02d%02d",y,m,md); +  return sprintf("%04d%02d%02d",((yd < 1)?y-1:y),m,md);    }       string format_ymd_xshort()    {    if (m==CALUNKNOWN) make_month(); -  return sprintf("%02d%02d%02d",y%100,m,md); +  return sprintf("%02d%02d%02d",((yd < 1)?y-1:y)%100,m,md);    }       string format_iso_week()