ctl.req.year, ctl.req.week);
while (m <= DECEMBER && yday > days_in_month[leap][m])
yday -= days_in_month[leap][m++];
- if (m > DECEMBER) {
+ if (DECEMBER < m && ctl.weektype & WEEK_NUM_ISO) {
/* In some years (e.g. 2010 in ISO mode) it's possible
* to have a remnant of week 53 starting the year yet
* the year in question ends during 52, in this case
38 259 260 261 262 263 264 265 43 294 295 296 297 298 299 300 47 322 323 324 325 326 327 328
39 266 267 268 269 270 271 272 44 301 302 303 304 48 329 330 331 332 333 334
\e[7m40\e[27m 273
+Gregorian - Sunday-based, week 54 with colors, 3 month
+ November 2000 December 2000 January 2001
+ Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
+45 1 2 3 4 49 1 2 1 1 2 3 4 5 6
+46 5 6 7 8 9 10 11 50 3 4 5 6 7 8 9 2 7 8 9 10 11 12 13
+47 12 13 14 15 16 17 18 51 10 11 12 13 14 15 16 3 14 15 16 17 18 19 20
+48 19 20 21 22 23 24 25 52 17 18 19 20 21 22 23 4 21 22 23 24 25 26 27
+49 26 27 28 29 30 53 24 25 26 27 28 29 30 5 28 29 30 31
+ \e[7m54\e[27m \e[7m31\e[27m
+Gregorian - Monday-based, week 53 with colors, 3 month
+cal: illegal week value: year 2000 doesn't have week 53
+Gregorian - Monday-based, week 52 with colors, 3 month
+ November 2000 December 2000 January 2001
+ Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
+44 1 2 3 4 5 48 1 2 3 1 1 2 3 4 5 6 7
+45 6 7 8 9 10 11 12 49 4 5 6 7 8 9 10 2 8 9 10 11 12 13 14
+46 13 14 15 16 17 18 19 50 11 12 13 14 15 16 17 3 15 16 17 18 19 20 21
+47 20 21 22 23 24 25 26 51 18 19 20 21 22 23 24 4 22 23 24 25 26 27 28
+48 27 28 29 30 \e[7m52\e[27m 25 26 27 28 29 30 \e[7m31\e[27m 5 29 30 31
+
fi
$TS_CMD_CAL -3mj $WEEK $MYTIME >> $TS_OUTPUT
+MYTIME="31 12 2000"
+PWEEK="week 54 with colors"
+WEEK="--week=54 --color=always"
+ts_log "Gregorian - Sunday-based, $PWEEK, 3 month $x"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --three --sunday $WEEK $MYTIME
+fi
+$TS_CMD_CAL --three --sunday $WEEK $MYTIME >> $TS_OUTPUT
+
+PWEEK="week 53 with colors"
+WEEK="--week=53 --color=always"
+ts_log "Gregorian - Monday-based, $PWEEK, 3 month $x"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --three --monday $WEEK $MYTIME
+fi
+$TS_CMD_CAL --three --monday $WEEK $MYTIME >> $TS_OUTPUT 2>&1
+
+PWEEK="week 52 with colors"
+WEEK="--week=52 --color=always"
+ts_log "Gregorian - Monday-based, $PWEEK, 3 month $x"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --three --monday $WEEK $MYTIME
+fi
+$TS_CMD_CAL --three --monday $WEEK $MYTIME >> $TS_OUTPUT 2>&1
+
+
ts_finalize