Modify to the last occurrence of a given day of the week in the current year. If no day_of_week is provided, modify to the last day of the year. Use the supplied consts to indicate the desired day_of_week, ex. DateTime.MONDAY.
(self, day_of_week: WeekDay | None = None)
| 1139 | return self.set(month=1).first_of("month", day_of_week) |
| 1140 | |
| 1141 | def _last_of_year(self, day_of_week: WeekDay | None = None) -> Self: |
| 1142 | """ |
| 1143 | Modify to the last occurrence of a given day of the week |
| 1144 | in the current year. If no day_of_week is provided, |
| 1145 | modify to the last day of the year. Use the supplied consts |
| 1146 | to indicate the desired day_of_week, ex. DateTime.MONDAY. |
| 1147 | """ |
| 1148 | return self.set(month=MONTHS_PER_YEAR).last_of("month", day_of_week) |
| 1149 | |
| 1150 | def _nth_of_year(self, nth: int, day_of_week: WeekDay | None = None) -> Self | None: |
| 1151 | """ |