Files
2025-11-28 16:23:32 +08:00

78 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# blade-starter-holidays
`blade-starter-holidays` 用来判断日期是否工作日,更具 php 版修改。支持2019年起至2024年 中国法定节假日以国务院发布的公告为准随时调整及增加http://www.gov.cn/zfwj/bgtfd.htm 或 http://www.gov.cn/zhengce/xxgkzl.htm
## 使用
### maven
```xml
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-holidays</artifactId>
<version>${version}</version>
</dependency>
```
### gradle
```groovy
compile("org.springblade:blade-starter-holidays:${version}")
```
### 注入 bean
```java
@Autowired
private HolidaysApi holidaysApi;
```
### 接口使用
```java
/**
* 获取日期类型
*
* @param localDate LocalDate
* @return DaysType
*/
DaysType getDaysType(LocalDate localDate);
/**
* 获取日期类型
*
* @param localDateTime LocalDateTime
* @return DaysType
*/
DaysType getDaysType(LocalDateTime localDateTime);
/**
* 获取日期类型
*
* @param date Date
* @return DaysType
*/
DaysType getDaysType(Date date);
/**
* 判断是否工作日
*
* @param localDate LocalDate
* @return 是否工作日
*/
boolean isWeekdays(LocalDate localDate);
/**
* 判断是否工作日
*
* @param localDateTime LocalDateTime
* @return 是否工作日
*/
boolean isWeekdays(LocalDateTime localDateTime);
/**
* 判断是否工作日
*
* @param date Date
* @return 是否工作日
*/
boolean isWeekdays(Date date);
```
## 链接
- holidays_api PHP 版https://gitee.com/web/holidays_api