PHPackages                             zhuxiaojin/holiday-china - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zhuxiaojin/holiday-china

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zhuxiaojin/holiday-china
========================

中国法定节假日判断

v1.0.0(7y ago)2338MITPHP

Since Oct 3Pushed 7y agoCompare

[ Source](https://github.com/zhuxiaojin/holiday-china)[ Packagist](https://packagist.org/packages/zhuxiaojin/holiday-china)[ RSS](/packages/zhuxiaojin-holiday-china/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

holiday-china
=============

[](#holiday-china)

中国法定节假日判断

安装
--

[](#安装)

```
$ composer require zhuxiaojin/holiday-china

```

使用
--

[](#使用)

```
$holiday=new Holiday();
// 获取某天数据
$holiday->holidayData('2018-10-03');
// 获取多天数据
$holiday->holidayDataList('2018-10-03,2018-10-04,2018-10-05');

```

参数说明
----

[](#参数说明)

```
function holidayData($date);
int $date 你要查询的日期，不传默认为今天 格式2018-10-03
function holidayDataList($dates);
array $dates 批量查询的日期集合，必填参数，格式['2019-01-13','2018-04-12']

```

laravel中使用
----------

[](#laravel中使用)

#### 参数注入

[](#参数注入)

```
public function edit(HolidayChina $holiday){
$response=$holiday->holidayData('2018-10-09');
}

```

#### 服务调用

[](#服务调用)

```
public function edit(){
$response=app('holiday')->holidayDataList(['2018-09-10']);
}

```

返回值
---

[](#返回值)

```
// 返回null说明不是
{
"code": 0,
"holiday": null
}
// holiday不为null,并且 holiday =false 说明该日期为节假日调休（补班）
{
    "code": 0,               // 0服务正常。-1服务出错
    "holiday": {
        "holiday": false,     // true表示是节假日，false表示是调休
        "name": "国庆前调休",  // 节假日的中文名。如果是调休，则是调休的中文名，例如'国庆前调休'
        "wage": 1,            // 薪资倍数，1表示是1倍工资
        "after": false,      // 只在调休下有该字段。true表示放完假后调休，false表示先调休再放假
        "target": '国庆节'    // 只在调休下有该字段。表示调休的节假日
    }
}

// holiday不为null,并且 holiday =true 说明该日期为节假日
{
    "code": 0,               // 0服务正常。-1服务出错
    "holiday": {
        "holiday": false,     // true表示是节假日，false表示是调休
        "name": "国庆前调休",  // 节假日的中文名。如果是调休，则是调休的中文名，例如'国庆前调休'
        "wage": 1,            // 薪资倍数，1表示是1倍工资
        "after": false,      // 只在调休下有该字段。true表示放完假后调休，false表示先调休再放假
        "target": '国庆节'    // 只在调休下有该字段。表示调休的节假日
    }
}
//如果是批量查询，则返回每一天的具体数据
{
    "code": 0,               // 0服务正常。-1服务出错
    "holiday": {             // 传过来的日期是什么，key就是什么。传多少个就有多少个。
        "2017-10-01": {      // holiday的值都是一致的
            "holiday": true,
            "name": "国庆节",
            "wage": 2
        },
        "2017-9-12": null    // 如果不是节假日，则为null
    }
}

```

友情提示
----

[](#友情提示)

该接口为第三方无偿提供，不限制调用次数，但是限于服务网络等原因，可能会出现延迟或无响应问题 推荐使用缓存结果信息

参考
--

[](#参考)

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2727d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5ce61a827061720d827cde1189e096e91ed757c1dbb38a40151a3a4fb4dc481?d=identicon)[zhuxiaojin](/maintainers/zhuxiaojin)

---

Top Contributors

[![zhuxiaojin](https://avatars.githubusercontent.com/u/23185069?v=4)](https://github.com/zhuxiaojin "zhuxiaojin (8 commits)")

### Embed Badge

![Health badge](/badges/zhuxiaojin-holiday-china/health.svg)

```
[![Health](https://phpackages.com/badges/zhuxiaojin-holiday-china/health.svg)](https://phpackages.com/packages/zhuxiaojin-holiday-china)
```

###  Alternatives

[nelexa/google-play-scraper

Scrapes app data from Google Play store.

88480.5k](/packages/nelexa-google-play-scraper)[oat-sa/lib-lti1p3-core

OAT LTI 1.3 Core Library

35327.1k9](/packages/oat-sa-lib-lti1p3-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
