PHPackages                             thefunpower/calendar - 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. thefunpower/calendar

ActiveLibrary

thefunpower/calendar
====================

日历

v2.0.7(1y ago)023Apache-2.0PHPPHP &gt;=7.1

Since Apr 16Pushed 1y agoCompare

[ Source](https://github.com/thefunpower/calendar)[ Packagist](https://packagist.org/packages/thefunpower/calendar)[ RSS](/packages/thefunpower-calendar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

日历
==

[](#日历)

安装
--

[](#安装)

```
composer require thefunpower/calendar

```

依赖`thefunpower/vue`

```
composer require thefunpower/vue

```

使用
--

[](#使用)

- 输出HTML代码

```
$year = 2024;
$month = 4;

$calendar = calendar_table::create([
  'url'=>'/attend/config/ajax',
  'year'=>$year,
  'month'=>$month,
  'html'=>1,
  'click'=>'calendar',
  'change'=>'load'
]);

$vue->method("calendar(date)","
  if(!date.date){return;}
  this.calendar_click_li_actived = date;
  console.log(date);
");

```

输出

```

```

- 使用AJAX数据

```
$year = g("year");
$month = g("month");
$type = g("type");
//设置企业工作日，一般周一到周五,如果周六上班对应数字6，周日上班对应数字0
\calendar_table::set("usually",[1,2,3,4,5]);
//设置法定节假日
\calendar_table::set("holiday",['2024-04-10','2024-04-11']);
//设置补班日，周末原本是休息，因节假日调整为上班的
\calendar_table::set("workday",['2024-04-14','2024-04-18']);
return \calendar_table::ajax([
    'year'=>$year,
    'month'=>$month,
    'usually'=>$usually,
    'type'=>$type,
]);

```

css
---

[](#css)

请自行复制 `css.css`

action用法
--------

[](#action用法)

```
do_action("calendar_table", $data);

```

处理

```
add_action("calendar_table", function(&$data)use($holiday,$holidays,$work) {
    foreach($data as &$v){
        foreach($v as &$vv){
            if( $holiday && in_array( $vv['full'],$holiday) ){
                $vv['title'] = $holidays[$vv['full']];
            }
        }
    }
});

```

效果图
---

[](#效果图)

[![效果图](test/demo.png)](test/demo.png)

### 开源协议

[](#开源协议)

[Apache License 2.0](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance43

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Every ~43 days

Recently: every ~75 days

Total

8

Last Release

451d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

php

### Embed Badge

![Health badge](/badges/thefunpower-calendar/health.svg)

```
[![Health](https://phpackages.com/badges/thefunpower-calendar/health.svg)](https://phpackages.com/packages/thefunpower-calendar)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

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