Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CcccFz authored Jul 15, 2021
1 parent 7aaa7c6 commit ccd4a37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
爬取法定节假日、法定工作日(补假日),转换为golang代码。可准确判断某天是节假日,还是工作日。

## Usage:
1. 运行python脚本,生成golang代码
2. 将生成的golang代码放到项目中,使用如下两个函数
1. 每年会在10~11月公告下一年的法定假日,和补假日。将下一年的公告页面URL加入python脚本的`CHINA_HOLIDAY_WORKDAY_URLS`中,即可:
![image](https://user-images.githubusercontent.com/11456678/125760514-34d43454-fe43-4376-884e-18dc8ea00750.png)
2. 运行python脚本,生成golang代码
3. 将生成的golang代码放到项目中,使用如下两个函数,既可准确判断某天是节假日,还是工作日:
```golang
util.IsHoliday(time.Now())
util.IsWorkday(time.Now())
```
3. 每年会在10~11月公告下一年的法定假日,和补假日。将下一年的公告页面URL加入python脚本的`CHINA_HOLIDAY_WORKDAY_URLS`即可:
![image](https://user-images.githubusercontent.com/11456678/125760314-bb5d0e98-fca6-4bb6-b2c0-33be4131ead5.png)

0 comments on commit ccd4a37

Please sign in to comment.