LKI / chinese-calendar

判断一天是不是法定节假日/法定工作日(查看节假日安排)
https://pypi.org/project/chinesecalendar/
MIT License
1.06k stars 185 forks source link

为什么今年的2月19也算春节? #56

Open juzstu opened 4 years ago

LKI commented 4 years ago

可以给一段重现的代码么? 下面的这段调用显示是正常的:

chinese_calendar.is_holiday(datetime.date(2020, 2, 19))  # False
juzstu commented 4 years ago

说错了是1月19 import chinese_calendar as cc cc.get_holiday_detail(datetime.date(2020, 1, 19))

LKI commented 4 years ago

噢,这个是个有点令人困惑的 feature,阐述在这里:https://github.com/LKI/chinese-calendar/issues/41#issuecomment-477587975

确认了一下,这个的确是有点困惑的 feature (以致于我都没反应过来 😀 )

get_holiday_detail 的功能是检查那天是不是节假日,并且返回当天的属性。 设想中的用法是“确认当天是否放假,并且展示相关的假期。”

的确这个返回让人有点困惑, 我想想,可能的话会在 2.0 里更新一下这个接口的实现。

xieyirmvb commented 4 years ago

噢,这个是个有点令人困惑的 feature,阐述在这里:#41 (comment)

确认了一下,这个的确是有点困惑的 feature (以致于我都没反应过来 😀 ) get_holiday_detail 的功能是检查那天是不是节假日,并且返回当天的属性。 设想中的用法是“确认当天是否放假,并且展示相关的假期。” 的确这个返回让人有点困惑, 我想想,可能的话会在 2.0 里更新一下这个接口的实现。

感觉可以 做类似的设计 春节假期期间: 1.春节当天返回 '春节' 2.其他日期返回 '春节假期'

cymx66688 commented 3 years ago

2.0什么时候更新呀