# Examples of subcommands ## Make output easy to parse ```sh week_calendar --for-machine date 2023 7 3 ``` Output: ```text 27 2023-07-03 2023-07-09 ``` ## Show current week calendar Examples today is 04.07.2023. ```sh week_calendar today ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 27 | 2023-07-03 | 2023-07-09 | +-------------+------------+------------+ ``` --- ## Show week calendar in which a specific date resides 30th of June in 2023 is given here. ```sh week_calendar date 2023 6 30 ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 26 | 2023-06-26 | 2023-07-02 | +-------------+------------+------------+ ``` --- ## Show all calendar weeks of the current month Example assumes today is 8th of august in 2023. ```sh week_calendar month ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 31 | 2023-07-31 | 2023-08-06 | +-------------+------------+------------+ | 32 | 2023-08-07 | 2023-08-13 | +-------------+------------+------------+ | 33 | 2023-08-14 | 2023-08-20 | +-------------+------------+------------+ | 34 | 2023-08-21 | 2023-08-27 | +-------------+------------+------------+ | 35 | 2023-08-28 | 2023-09-03 | +-------------+------------+------------+ ``` --- ## Show all calendar weeks of a given month in the current year Here the given month is April in 2023 as current year. ```sh week_calendar month 4 ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 13 | 2023-03-27 | 2023-04-02 | +-------------+------------+------------+ | 14 | 2023-04-03 | 2023-04-09 | +-------------+------------+------------+ | 15 | 2023-04-10 | 2023-04-16 | +-------------+------------+------------+ | 16 | 2023-04-17 | 2023-04-23 | +-------------+------------+------------+ | 17 | 2023-04-24 | 2023-04-30 | +-------------+------------+------------+ ``` --- ## Show all calendar weeks of a given month in a given year Here the given month is May in 1990 as given year. ```sh week_calendar month 3 1990 ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 9 | 1990-02-26 | 1990-03-04 | +-------------+------------+------------+ | 10 | 1990-03-05 | 1990-03-11 | +-------------+------------+------------+ | 11 | 1990-03-12 | 1990-03-18 | +-------------+------------+------------+ | 12 | 1990-03-19 | 1990-03-25 | +-------------+------------+------------+ | 13 | 1990-03-26 | 1990-04-01 | +-------------+------------+------------+ ``` --- ## Show all calendar weeks in the current year Here the current year is 2023. ```sh week_calendar year ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 52 | 2022-12-26 | 2023-01-01 | +-------------+------------+------------+ | 1 | 2023-01-02 | 2023-01-08 | +-------------+------------+------------+ | 2 | 2023-01-09 | 2023-01-15 | +-------------+------------+------------+ | 3 | 2023-01-16 | 2023-01-22 | +-------------+------------+------------+ | 4 | 2023-01-23 | 2023-01-29 | +-------------+------------+------------+ | 5 | 2023-01-30 | 2023-02-05 | +-------------+------------+------------+ | 6 | 2023-02-06 | 2023-02-12 | +-------------+------------+------------+ | 7 | 2023-02-13 | 2023-02-19 | +-------------+------------+------------+ | 8 | 2023-02-20 | 2023-02-26 | +-------------+------------+------------+ | 9 | 2023-02-27 | 2023-03-05 | +-------------+------------+------------+ | 10 | 2023-03-06 | 2023-03-12 | +-------------+------------+------------+ | 11 | 2023-03-13 | 2023-03-19 | +-------------+------------+------------+ | 12 | 2023-03-20 | 2023-03-26 | +-------------+------------+------------+ | 13 | 2023-03-27 | 2023-04-02 | +-------------+------------+------------+ | 14 | 2023-04-03 | 2023-04-09 | +-------------+------------+------------+ | 15 | 2023-04-10 | 2023-04-16 | +-------------+------------+------------+ | 16 | 2023-04-17 | 2023-04-23 | +-------------+------------+------------+ | 17 | 2023-04-24 | 2023-04-30 | +-------------+------------+------------+ | 18 | 2023-05-01 | 2023-05-07 | +-------------+------------+------------+ | 19 | 2023-05-08 | 2023-05-14 | +-------------+------------+------------+ | 20 | 2023-05-15 | 2023-05-21 | +-------------+------------+------------+ | 21 | 2023-05-22 | 2023-05-28 | +-------------+------------+------------+ | 22 | 2023-05-29 | 2023-06-04 | +-------------+------------+------------+ | 23 | 2023-06-05 | 2023-06-11 | +-------------+------------+------------+ | 24 | 2023-06-12 | 2023-06-18 | +-------------+------------+------------+ | 25 | 2023-06-19 | 2023-06-25 | +-------------+------------+------------+ | 26 | 2023-06-26 | 2023-07-02 | +-------------+------------+------------+ | 27 | 2023-07-03 | 2023-07-09 | +-------------+------------+------------+ | 28 | 2023-07-10 | 2023-07-16 | +-------------+------------+------------+ | 29 | 2023-07-17 | 2023-07-23 | +-------------+------------+------------+ | 30 | 2023-07-24 | 2023-07-30 | +-------------+------------+------------+ | 31 | 2023-07-31 | 2023-08-06 | +-------------+------------+------------+ | 32 | 2023-08-07 | 2023-08-13 | +-------------+------------+------------+ | 33 | 2023-08-14 | 2023-08-20 | +-------------+------------+------------+ | 34 | 2023-08-21 | 2023-08-27 | +-------------+------------+------------+ | 35 | 2023-08-28 | 2023-09-03 | +-------------+------------+------------+ | 36 | 2023-09-04 | 2023-09-10 | +-------------+------------+------------+ | 37 | 2023-09-11 | 2023-09-17 | +-------------+------------+------------+ | 38 | 2023-09-18 | 2023-09-24 | +-------------+------------+------------+ | 39 | 2023-09-25 | 2023-10-01 | +-------------+------------+------------+ | 40 | 2023-10-02 | 2023-10-08 | +-------------+------------+------------+ | 41 | 2023-10-09 | 2023-10-15 | +-------------+------------+------------+ | 42 | 2023-10-16 | 2023-10-22 | +-------------+------------+------------+ | 43 | 2023-10-23 | 2023-10-29 | +-------------+------------+------------+ | 44 | 2023-10-30 | 2023-11-05 | +-------------+------------+------------+ | 45 | 2023-11-06 | 2023-11-12 | +-------------+------------+------------+ | 46 | 2023-11-13 | 2023-11-19 | +-------------+------------+------------+ | 47 | 2023-11-20 | 2023-11-26 | +-------------+------------+------------+ | 48 | 2023-11-27 | 2023-12-03 | +-------------+------------+------------+ | 49 | 2023-12-04 | 2023-12-10 | +-------------+------------+------------+ | 50 | 2023-12-11 | 2023-12-17 | +-------------+------------+------------+ | 51 | 2023-12-18 | 2023-12-24 | +-------------+------------+------------+ | 52 | 2023-12-25 | 2023-12-31 | +-------------+------------+------------+ ``` --- ## Show all week calendar in the given year Here the given year is 1992. ```sh week_calendar year 1992 ``` Output: ```text +-------------+------------+------------+ | Week Number | From | To | +-------------+------------+------------+ | 52 | 1991-12-30 | 1992-01-05 | +-------------+------------+------------+ | 1 | 1992-01-06 | 1992-01-12 | +-------------+------------+------------+ | 2 | 1992-01-13 | 1992-01-19 | +-------------+------------+------------+ | 3 | 1992-01-20 | 1992-01-26 | +-------------+------------+------------+ | 4 | 1992-01-27 | 1992-02-02 | +-------------+------------+------------+ | 5 | 1992-02-03 | 1992-02-09 | +-------------+------------+------------+ | 6 | 1992-02-10 | 1992-02-16 | +-------------+------------+------------+ | 7 | 1992-02-17 | 1992-02-23 | +-------------+------------+------------+ | 8 | 1992-02-24 | 1992-03-01 | +-------------+------------+------------+ | 9 | 1992-03-02 | 1992-03-08 | +-------------+------------+------------+ | 10 | 1992-03-09 | 1992-03-15 | +-------------+------------+------------+ | 11 | 1992-03-16 | 1992-03-22 | +-------------+------------+------------+ | 12 | 1992-03-23 | 1992-03-29 | +-------------+------------+------------+ | 13 | 1992-03-30 | 1992-04-05 | +-------------+------------+------------+ | 14 | 1992-04-06 | 1992-04-12 | +-------------+------------+------------+ | 15 | 1992-04-13 | 1992-04-19 | +-------------+------------+------------+ | 16 | 1992-04-20 | 1992-04-26 | +-------------+------------+------------+ | 17 | 1992-04-27 | 1992-05-03 | +-------------+------------+------------+ | 18 | 1992-05-04 | 1992-05-10 | +-------------+------------+------------+ | 19 | 1992-05-11 | 1992-05-17 | +-------------+------------+------------+ | 20 | 1992-05-18 | 1992-05-24 | +-------------+------------+------------+ | 21 | 1992-05-25 | 1992-05-31 | +-------------+------------+------------+ | 22 | 1992-06-01 | 1992-06-07 | +-------------+------------+------------+ | 23 | 1992-06-08 | 1992-06-14 | +-------------+------------+------------+ | 24 | 1992-06-15 | 1992-06-21 | +-------------+------------+------------+ | 25 | 1992-06-22 | 1992-06-28 | +-------------+------------+------------+ | 26 | 1992-06-29 | 1992-07-05 | +-------------+------------+------------+ | 27 | 1992-07-06 | 1992-07-12 | +-------------+------------+------------+ | 28 | 1992-07-13 | 1992-07-19 | +-------------+------------+------------+ | 29 | 1992-07-20 | 1992-07-26 | +-------------+------------+------------+ | 30 | 1992-07-27 | 1992-08-02 | +-------------+------------+------------+ | 31 | 1992-08-03 | 1992-08-09 | +-------------+------------+------------+ | 32 | 1992-08-10 | 1992-08-16 | +-------------+------------+------------+ | 33 | 1992-08-17 | 1992-08-23 | +-------------+------------+------------+ | 34 | 1992-08-24 | 1992-08-30 | +-------------+------------+------------+ | 35 | 1992-08-31 | 1992-09-06 | +-------------+------------+------------+ | 36 | 1992-09-07 | 1992-09-13 | +-------------+------------+------------+ | 37 | 1992-09-14 | 1992-09-20 | +-------------+------------+------------+ | 38 | 1992-09-21 | 1992-09-27 | +-------------+------------+------------+ | 39 | 1992-09-28 | 1992-10-04 | +-------------+------------+------------+ | 40 | 1992-10-05 | 1992-10-11 | +-------------+------------+------------+ | 41 | 1992-10-12 | 1992-10-18 | +-------------+------------+------------+ | 42 | 1992-10-19 | 1992-10-25 | +-------------+------------+------------+ | 43 | 1992-10-26 | 1992-11-01 | +-------------+------------+------------+ | 44 | 1992-11-02 | 1992-11-08 | +-------------+------------+------------+ | 45 | 1992-11-09 | 1992-11-15 | +-------------+------------+------------+ | 46 | 1992-11-16 | 1992-11-22 | +-------------+------------+------------+ | 47 | 1992-11-23 | 1992-11-29 | +-------------+------------+------------+ | 48 | 1992-11-30 | 1992-12-06 | +-------------+------------+------------+ | 49 | 1992-12-07 | 1992-12-13 | +-------------+------------+------------+ | 50 | 1992-12-14 | 1992-12-20 | +-------------+------------+------------+ | 51 | 1992-12-21 | 1992-12-27 | +-------------+------------+------------+ | 52 | 1992-12-28 | 1993-01-03 | +-------------+------------+------------+ ```