Closed shirleysheng closed 3 years ago
is_holiday 的判定是包括普通周末的~ 相当于判定,中国大陆的普通人在那天会不会工作~
def is_holiday(date):
"""
check if one date is holiday in China.
in other words, Chinese people get rest at that day.
:type date: datetime.date | datetime.datetime
:rtype: bool
"""
假如要判定是因为普通周末,还是因为节假日的话,
需要用 get_holiday_detail
函数的第二个参数判定。
chinese_calendar.get_holiday_detail(datetime.date(2005, 1, 16)) 返回(True, None)
比如这个就代表05年1月16日放假是因为普通周末~
get!感谢
您好,在对2005年-2013年日期进行判断时发现很多个周末会被判断为节假日 例如is_holiday(datetime.date(2005, 1, 16)) 返回True chinese_calendar.get_holiday_detail(datetime.date(2005, 1, 16)) 返回(True, None) 这是什么情况呢