Commit 50c32647 authored by ZZH's avatar ZZH

fix is_workday, is_holiday 2024-07-30

parent 2068ea7f
...@@ -113,10 +113,16 @@ class ChineseCalendar: ...@@ -113,10 +113,16 @@ class ChineseCalendar:
date_str: str date_str: str
def is_workday(self) -> bool: def is_workday(self) -> bool:
try:
return is_workday(datetime.strptime(self.date_str, "%Y-%m-%d")) return is_workday(datetime.strptime(self.date_str, "%Y-%m-%d"))
except Exception as e:
return False
def is_holiday(self) -> bool: def is_holiday(self) -> bool:
try:
return is_holiday(datetime.strptime(self.date_str, "%Y-%m-%d")) return is_holiday(datetime.strptime(self.date_str, "%Y-%m-%d"))
except Exception as e:
return False
def multiplication_two(a, b): 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