MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / _first_of_quarter

Method _first_of_quarter

src/pendulum/datetime.py:1087–1096  ·  view source on GitHub ↗

Modify to the first occurrence of a given day of the week in the current quarter. If no day_of_week is provided, modify to the first day of the quarter. Use the supplied consts to indicate the desired day_of_week, ex. DateTime.MONDAY.

(self, day_of_week: WeekDay | None = None)

Source from the content-addressed store, hash-verified

1085 return None
1086
1087 def _first_of_quarter(self, day_of_week: WeekDay | None = None) -> Self:
1088 """
1089 Modify to the first occurrence of a given day of the week
1090 in the current quarter. If no day_of_week is provided,
1091 modify to the first day of the quarter. Use the supplied consts
1092 to indicate the desired day_of_week, ex. DateTime.MONDAY.
1093 """
1094 return self.on(self.year, self.quarter * 3 - 2, 1).first_of(
1095 "month", day_of_week
1096 )
1097
1098 def _last_of_quarter(self, day_of_week: WeekDay | None = None) -> Self:
1099 """

Callers

nothing calls this directly

Calls 2

onMethod · 0.95
first_ofMethod · 0.45

Tested by

no test coverage detected