summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cal.c
AgeCommit message (Collapse)Author
2021-06-19cal: fix days of week alignment for year view (thanks igor@9lab.org)kvik
term% cal -s1 2021 2021 Jan Feb Mar M Tu W Th F Sa Su M Tu W Th F Sa Su M Tu W Th F Sa Su 1 2 3 1 2 3 4 5 6 7 1 2 3 4 5 6 7 4 5 6 7 8 9 10 8 9 10 11 12 13 14 8 9 10 11 12 13 14 11 12 13 14 15 16 17 15 16 17 18 19 20 21 15 16 17 18 19 20 21 18 19 20 21 22 23 24 22 23 24 25 26 27 28 22 23 24 25 26 27 28 25 26 27 28 29 30 31 29 30 31 … Note how the days (i.e. ' M Tu W Th F Sa Su') for Feb and Mar do not align with the day numbers. This is because an extra space is left *before* adding the terminating '\0' via the pointer `dayw`. With the patch applied the calendar aligns nicely for the year view: term% cal -s1 2021 2021 Jan Feb Mar M Tu W Th F Sa Su M Tu W Th F Sa Su M Tu W Th F Sa Su 1 2 3 1 2 3 4 5 6 7 1 2 3 4 5 6 7 4 5 6 7 8 9 10 8 9 10 11 12 13 14 8 9 10 11 12 13 14 11 12 13 14 15 16 17 15 16 17 18 19 20 21 15 16 17 18 19 20 21 18 19 20 21 22 23 24 22 23 24 25 26 27 28 22 23 24 25 26 27 28 25 26 27 28 29 30 31 29 30 31 …
2021-01-12cal: use Sa/Su in all cases, also simplify the codeSigrid
2021-01-12cal: fix -s 7Sigrid
2021-01-12cal: add -s option to specify the starting day of the weekSigrid
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen