Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

节假日判断混乱。 #50

Open
houchenyu opened this issue Dec 26, 2019 · 4 comments
Open

节假日判断混乱。 #50

houchenyu opened this issue Dec 26, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@houchenyu
Copy link

用get_holiday_detail函数输出是否是节假日以及节假日名称时非常混乱。
比如 劳动节,只有2017-05-01号有name输出
而端午节,反而有2017-05-27到2017-05-30都算端午节,有name输出。

@LKI
Copy link
Owner

LKI commented Dec 26, 2019

嗯,的确没有很好的文档来说明一下这个函数的用法。

目前比较清晰的解释在 #47 这里:

get_holiday_detail 会返回两个参数,
第一个返回值是布尔值代表那一天是不是节假日,
第二个可空的字符串值代表那天的含义。

比如 get_holiday_detail(date(2017, 1, 22)) 返回的是 `(False, 'Spring Festival')',
代表那一天不是节假日,但是是因为春节而调休的。

@LKI in #47 (comment)

@LKI LKI self-assigned this Dec 26, 2019
@LKI LKI added the question label Dec 26, 2019
@LKI
Copy link
Owner

LKI commented Dec 26, 2019

文档化的问题的确是需要添加一下 readme

@houchenyu
Copy link
Author

我看了data.py里放假的定义,发现2020年之前与之后定义好像有点不一样。
举个例子: 2019年里, 端午节:6月7日放假,与周末连休。(这里用get_holiday_detail方法只有在6.7会返回节假日名,而 6.8 6.9都返回None, 因为没有把6.8和6.9作为端午节放假加到数据中。)
而在2020年之后,这种休息三天的情况都是可以返回节假日名。
建议改一下 data.py, 都改成2020年之后的那种方式。

@LKI LKI added this to the v2.0 milestone Dec 15, 2020
@cymx66688
Copy link

2020年6月28日不是节假日却显示是端午节

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants