Revised the way to import from the datetime package, to avoid name conflict with the common "date" and "time" names.

This commit is contained in:
2023-04-26 13:17:31 +08:00
parent c11ae23885
commit 359c335662
30 changed files with 156 additions and 152 deletions

View File

@ -18,14 +18,14 @@
"""
import calendar
from datetime import date
import datetime as dt
def month_end(day: date) -> date:
def month_end(day: dt.date) -> dt.date:
"""Returns the end day of month for a date.
:param day: The date.
:return: The end day of the month of that day.
"""
last_day: int = calendar.monthrange(day.year, day.month)[1]
return date(day.year, day.month, last_day)
return dt.date(day.year, day.month, last_day)