Commit 50c32647 authored by ZZH's avatar ZZH

fix is_workday, is_holiday 2024-07-30

parent 2068ea7f
......@@ -113,10 +113,16 @@ class ChineseCalendar:
date_str: str
def is_workday(self) -> bool:
return is_workday(datetime.strptime(self.date_str, "%Y-%m-%d"))
try:
return is_workday(datetime.strptime(self.date_str, "%Y-%m-%d"))
except Exception as e:
return False
def is_holiday(self) -> bool:
return is_holiday(datetime.strptime(self.date_str, "%Y-%m-%d"))
try:
return is_holiday(datetime.strptime(self.date_str, "%Y-%m-%d"))
except Exception as e:
return False
def multiplication_two(a, b):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment