nushell/docs/commands/cal.md
2020-06-24 17:15:19 +12:00

205 lines
23 KiB
Markdown

# cal
Use `cal` to display a calendar.
## Flags
* `-y`, `--year`: Display the year column
* `-q`, `--quarter`: Display the quarter column
* `-m`, `--month`: Display the month column
* `--full-year` \<integer>: Display a year-long calendar for the specified year
* `--week-start` \<string>: Display the calendar with the specified day as the first day of the week
* `--month-names`: Display the month names instead of integers
## Examples
```shell
> cal
───┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
# │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
───┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
0 │ │ │ │ │ │ 1 │ 2
1 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9
2 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16
3 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23
4 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30
5 │ 31 │ │ │ │ │ │
───┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -yqm --full-year 2020
────┬──────┬─────────┬───────┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
# │ year │ quarter │ month │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
────┼──────┼─────────┼───────┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
0 │ 2020 │ 1 │ 1 │ │ │ │ 1 │ 2 │ 3 │ 4
1 │ 2020 │ 1 │ 1 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11
2 │ 2020 │ 1 │ 1 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18
3 │ 2020 │ 1 │ 1 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25
4 │ 2020 │ 1 │ 1 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │
5 │ 2020 │ 1 │ 2 │ │ │ │ │ │ │ 1
6 │ 2020 │ 1 │ 2 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8
7 │ 2020 │ 1 │ 2 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15
8 │ 2020 │ 1 │ 2 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22
9 │ 2020 │ 1 │ 2 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29
10 │ 2020 │ 1 │ 3 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7
11 │ 2020 │ 1 │ 3 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14
12 │ 2020 │ 1 │ 3 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21
13 │ 2020 │ 1 │ 3 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28
14 │ 2020 │ 1 │ 3 │ 29 │ 30 │ 31 │ │ │ │
15 │ 2020 │ 2 │ 4 │ │ │ │ 1 │ 2 │ 3 │ 4
16 │ 2020 │ 2 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11
17 │ 2020 │ 2 │ 4 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18
18 │ 2020 │ 2 │ 4 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25
19 │ 2020 │ 2 │ 4 │ 26 │ 27 │ 28 │ 29 │ 30 │ │
20 │ 2020 │ 2 │ 5 │ │ │ │ │ │ 1 │ 2
21 │ 2020 │ 2 │ 5 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9
22 │ 2020 │ 2 │ 5 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16
23 │ 2020 │ 2 │ 5 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23
24 │ 2020 │ 2 │ 5 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30
25 │ 2020 │ 2 │ 5 │ 31 │ │ │ │ │ │
26 │ 2020 │ 2 │ 6 │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6
27 │ 2020 │ 2 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13
28 │ 2020 │ 2 │ 6 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20
29 │ 2020 │ 2 │ 6 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27
30 │ 2020 │ 2 │ 6 │ 28 │ 29 │ 30 │ │ │ │
31 │ 2020 │ 3 │ 7 │ │ │ │ 1 │ 2 │ 3 │ 4
32 │ 2020 │ 3 │ 7 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11
33 │ 2020 │ 3 │ 7 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18
34 │ 2020 │ 3 │ 7 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25
35 │ 2020 │ 3 │ 7 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │
36 │ 2020 │ 3 │ 8 │ │ │ │ │ │ │ 1
37 │ 2020 │ 3 │ 8 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8
38 │ 2020 │ 3 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15
39 │ 2020 │ 3 │ 8 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22
40 │ 2020 │ 3 │ 8 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29
41 │ 2020 │ 3 │ 8 │ 30 │ 31 │ │ │ │ │
42 │ 2020 │ 3 │ 9 │ │ │ 1 │ 2 │ 3 │ 4 │ 5
43 │ 2020 │ 3 │ 9 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12
44 │ 2020 │ 3 │ 9 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19
45 │ 2020 │ 3 │ 9 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26
46 │ 2020 │ 3 │ 9 │ 27 │ 28 │ 29 │ 30 │ │ │
47 │ 2020 │ 4 │ 10 │ │ │ │ │ 1 │ 2 │ 3
48 │ 2020 │ 4 │ 10 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10
49 │ 2020 │ 4 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17
50 │ 2020 │ 4 │ 10 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24
51 │ 2020 │ 4 │ 10 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31
52 │ 2020 │ 4 │ 11 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7
53 │ 2020 │ 4 │ 11 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14
54 │ 2020 │ 4 │ 11 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21
55 │ 2020 │ 4 │ 11 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28
56 │ 2020 │ 4 │ 11 │ 29 │ 30 │ │ │ │ │
57 │ 2020 │ 4 │ 12 │ │ │ 1 │ 2 │ 3 │ 4 │ 5
58 │ 2020 │ 4 │ 12 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12
59 │ 2020 │ 4 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19
60 │ 2020 │ 4 │ 12 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26
61 │ 2020 │ 4 │ 12 │ 27 │ 28 │ 29 │ 30 │ 31 │ │
────┴──────┴─────────┴───────┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -yqm --full-year 2020 --month-names
────┬──────┬─────────┬───────────┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
# │ year │ quarter │ month │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
────┼──────┼─────────┼───────────┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
020201 │ january │ │ │ │ 1234
120201 │ january │ 567891011
220201 │ january │ 12131415161718
320201 │ january │ 19202122232425
420201 │ january │ 262728293031
520201 │ february │ │ │ │ │ │ │ 1
620201 │ february │ 2345678
720201 │ february │ 9101112131415
820201 │ february │ 16171819202122
920201 │ february │ 23242526272829
1020201 │ march │ 1234567
1120201 │ march │ 891011121314
1220201 │ march │ 15161718192021
1320201 │ march │ 22232425262728
1420201 │ march │ 293031 │ │ │ │
1520202 │ april │ │ │ │ 1234
1620202 │ april │ 567891011
1720202 │ april │ 12131415161718
1820202 │ april │ 19202122232425
1920202 │ april │ 2627282930 │ │
2020202 │ may │ │ │ │ │ │ 12
2120202 │ may │ 3456789
2220202 │ may │ 10111213141516
2320202 │ may │ 17181920212223
2420202 │ may │ 24252627282930
2520202 │ may │ 31 │ │ │ │ │ │
2620202 │ june │ │ 123456
2720202 │ june │ 78910111213
2820202 │ june │ 14151617181920
2920202 │ june │ 21222324252627
3020202 │ june │ 282930 │ │ │ │
3120203 │ july │ │ │ │ 1234
3220203 │ july │ 567891011
3320203 │ july │ 12131415161718
3420203 │ july │ 19202122232425
3520203 │ july │ 262728293031
3620203 │ august │ │ │ │ │ │ │ 1
3720203 │ august │ 2345678
3820203 │ august │ 9101112131415
3920203 │ august │ 16171819202122
4020203 │ august │ 23242526272829
4120203 │ august │ 3031 │ │ │ │ │
4220203 │ september │ │ │ 12345
4320203 │ september │ 6789101112
4420203 │ september │ 13141516171819
4520203 │ september │ 20212223242526
4620203 │ september │ 27282930 │ │ │
4720204 │ october │ │ │ │ │ 123
4820204 │ october │ 45678910
4920204 │ october │ 11121314151617
5020204 │ october │ 18192021222324
5120204 │ october │ 25262728293031
5220204 │ november │ 1234567
5320204 │ november │ 891011121314
5420204 │ november │ 15161718192021
5520204 │ november │ 22232425262728
5620204 │ november │ 2930 │ │ │ │ │
5720204 │ december │ │ │ 12345
5820204 │ december │ 6789101112
5920204 │ december │ 13141516171819
6020204 │ december │ 20212223242526
6120204 │ december │ 2728293031 │ │
────┴──────┴─────────┴───────────┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -ym --full-year 2303 --month-names | where month == "june"
───┬──────┬───────┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
# │ year │ month │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
───┼──────┼───────┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
02303 │ june │ │ 123456
12303 │ june │ 78910111213
22303 │ june │ 14151617181920
32303 │ june │ 21222324252627
42303 │ june │ 282930 │ │ │ │
───┴──────┴───────┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -my --full-year 2020 --month-names | default friday 0 | where friday == 13
───┬──────┬──────────┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
# │ year │ month │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
───┼──────┼──────────┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
02020 │ march │ 891011121314
12020 │ november │ 891011121314
───┴──────┴──────────┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────
```
```shell
> cal -ymq --month-names --week-start monday
───┬──────┬─────────┬───────┬────────┬─────────┬───────────┬──────────┬────────┬──────────┬────────
# │ year │ quarter │ month │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday │ sunday
───┼──────┼─────────┼───────┼────────┼─────────┼───────────┼──────────┼────────┼──────────┼────────
020202 │ june │ 1234567
120202 │ june │ 891011121314
220202 │ june │ 15161718192021
320202 │ june │ 22232425262728
420202 │ june │ 2930 │ │ │ │ │
───┴──────┴─────────┴───────┴────────┴─────────┴───────────┴──────────┴────────┴──────────┴────────
```