feat: Add get_first_day_of_week utillity method
This commit is contained in:
parent
b0741a9b26
commit
2b85f4996c
1 changed files with 3 additions and 0 deletions
|
|
@ -182,6 +182,9 @@ def get_first_day(dt, d_years=0, d_months=0):
|
|||
|
||||
return datetime.date(year, month + 1, 1)
|
||||
|
||||
def get_first_day_of_week(dt):
|
||||
return dt - datetime.timedelta(days=dt.weekday())
|
||||
|
||||
def get_last_day(dt):
|
||||
"""
|
||||
Returns last day of the month using:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue