Modify to the first occurrence of a given day of the week in the current year. If no day_of_week is provided, modify to the first 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)
| 1130 | return self.on(self.year, dt.month, dt.day).start_of("day") |
| 1131 | |
| 1132 | def _first_of_year(self, day_of_week: WeekDay | None = None) -> Self: |
| 1133 | """ |
| 1134 | Modify to the first occurrence of a given day of the week |
| 1135 | in the current year. If no day_of_week is provided, |
| 1136 | modify to the first day of the year. Use the supplied consts |
| 1137 | to indicate the desired day_of_week, ex. DateTime.MONDAY. |
| 1138 | """ |
| 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 | """ |