docs: typing overloads for get_first_day_of_week/last_day_of_week
This commit is contained in:
parent
cdbe3555f6
commit
d0d78f65e9
1 changed files with 20 additions and 0 deletions
|
|
@ -475,6 +475,16 @@ def get_quarter_start(dt, as_str: bool = False) -> str | datetime.date:
|
|||
return first_date_of_quarter.strftime(DATE_FORMAT) if as_str else first_date_of_quarter
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_first_day_of_week(dt: DateTimeLikeObject, as_str: Literal[False] = False) -> datetime.date:
|
||||
...
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_first_day_of_week(dt: DateTimeLikeObject, as_str: Literal[True] = False) -> str:
|
||||
...
|
||||
|
||||
|
||||
def get_first_day_of_week(dt: DateTimeLikeObject, as_str=False) -> datetime.date | str:
|
||||
"""Returns the first day of the week (as per System Settings or Sunday by default) for the given datetime like object (`dt`).
|
||||
|
||||
|
|
@ -507,6 +517,16 @@ def get_year_start(dt: DateTimeLikeObject, as_str=False) -> str | datetime.date:
|
|||
return date.strftime(DATE_FORMAT) if as_str else date
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_last_day_of_week(dt: DateTimeLikeObject, as_str: Literal[False] = False) -> datetime.date:
|
||||
...
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_last_day_of_week(dt: DateTimeLikeObject, as_str: Literal[True] = False) -> str:
|
||||
...
|
||||
|
||||
|
||||
def get_last_day_of_week(dt: DateTimeLikeObject, as_str=False) -> datetime.date | str:
|
||||
"""Returns the last day of the week (first day is taken from System Settings or Sunday by default) for the given datetime like object (`dt`).
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue