|
68 | 68 | (test (d/after-or-eq? (d/date 2021 7 1) (d/date 2021 7 1)) true) |
69 | 69 | (test (not (d/after-or-eq? (d/date 2021 7 1) (d/date 2021 7 15))) true)) |
70 | 70 |
|
| 71 | +## ————————————————————————————————————————————————————————————————————————————————————————————————— |
| 72 | +## Test weekday? |
| 73 | + |
| 74 | +(deftest "returns true if the date is a weekday" |
| 75 | + (test (d/weekday? (d/date 2022 1 3)) true) |
| 76 | + (test (d/weekday? (d/date 2022 1 4)) true) |
| 77 | + (test (d/weekday? (d/date 2022 1 5)) true) |
| 78 | + (test (d/weekday? (d/date 2022 1 6)) true) |
| 79 | + (test (d/weekday? (d/date 2022 1 7)) true) |
| 80 | + (test (d/weekday? (d/date 2022 1 8)) false) |
| 81 | + (test (d/weekday? (d/date 2022 1 9)) false)) |
| 82 | + |
71 | 83 | ## ————————————————————————————————————————————————————————————————————————————————————————————————— |
72 | 84 | ## Test last-day-of-month? |
73 | 85 |
|
|
88 | 100 | (test (not (d/last-day-of-month? (d/date 2022 1 30))) true)) |
89 | 101 |
|
90 | 102 | ## ————————————————————————————————————————————————————————————————————————————————————————————————— |
91 | | -## Test last-Friday-of-month? |
| 103 | +## Test last-weekday-of-month? |
| 104 | + |
| 105 | +(deftest "returns true when the date is the last week day of the month" |
| 106 | + (test (d/last-weekday-of-month? (d/date 2022 1 31)) true) |
| 107 | + (test (d/last-weekday-of-month? (d/date 2022 2 28)) true) |
| 108 | + (test (d/last-weekday-of-month? (d/date 2022 3 31)) true) |
| 109 | + (test (d/last-weekday-of-month? (d/date 2022 4 29)) true) |
| 110 | + (test (d/last-weekday-of-month? (d/date 2022 5 31)) true) |
| 111 | + (test (d/last-weekday-of-month? (d/date 2022 6 30)) true) |
| 112 | + (test (d/last-weekday-of-month? (d/date 2022 7 29)) true) |
| 113 | + (test (d/last-weekday-of-month? (d/date 2022 8 31)) true) |
| 114 | + (test (d/last-weekday-of-month? (d/date 2022 9 30)) true) |
| 115 | + (test (d/last-weekday-of-month? (d/date 2022 10 31)) true) |
| 116 | + (test (d/last-weekday-of-month? (d/date 2022 11 30)) true) |
| 117 | + (test (d/last-weekday-of-month? (d/date 2022 12 30)) true) |
| 118 | + (test (not (d/last-weekday-of-month? (d/date 2022 1 30))) true)) |
| 119 | + |
| 120 | +## ————————————————————————————————————————————————————————————————————————————————————————————————— |
| 121 | +## Test last-friday-of-month? |
92 | 122 |
|
93 | 123 | (deftest "returns true when the date is the last friday of the month" |
94 | 124 | (test (d/last-friday-of-month? (d/date 2022 1 28)) true) |
|
0 commit comments