PHPackages                             tito10047/php-callendar - 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. tito10047/php-callendar

Abandoned → [tito10047/php-calendar](/?search=tito10047%2Fphp-calendar)Library[Utility &amp; Helpers](/categories/utility)

tito10047/php-callendar
=======================

Framework-agnostic PHP calendar data library — monthly, weekly and work-week grids, RFC 5545 recurrence rules, iCal import/export, and resource scheduling.

1.1.0(1mo ago)598PHPPHP &gt;=8.2CI failing

Since Nov 29Pushed 5mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (11)Used By (0)

php-calendar
============

[](#php-calendar)

[![PHP Tests](https://github.com/tito10047/php-calendar/actions/workflows/symfony.yml/badge.svg)](https://github.com/tito10047/php-calendar/actions/workflows/symfony.yml)[![PHP Version](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/1ce887ab97673a4073429f1a18bd8c9557970cf8b0901e69b1911ca106833a68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7469746f31303034372f7068702d63616c656e646172)](LICENSE)

**Pure PHP calendar library. Zero dependencies. Built for server-side rendering.**

Feed it a date. Get back a typed `Day[][]` table. Build your own template.

---

Why server-side?
----------------

[](#why-server-side)

- Works with Symfony UX Turbo / Livewire — no hydration, no client state sync
- Zero frontend dependencies — just your own HTML and CSS
- Every cell carries arbitrary data attached via a simple interface
- Fully immutable — every mutation returns a new instance

---

Installation
------------

[](#installation)

```
composer require tito10047/php-calendar
```

Requires PHP 8.2+. No other dependencies.

---

Quick start
-----------

[](#quick-start)

```
use Tito10047\Calendar\Calendar;
use Tito10047\Calendar\Enum\CalendarType;
use Tito10047\Calendar\Enum\DayName;

$calendar = Calendar::forMonth(2024, 11)
    ->disableDaysByName(DayName::Saturday, DayName::Sunday)
    ->setDataLoader(new MyEventLoader());

$table = $calendar->getDaysTable();
// array
```

```

        {% for week in table %}

                {% for day in week %}

                        {% if not day.ghost %}
                            {{ day.date|date('j') }}
                            {% for event in day.data ?? [] %}
                                {{ event.title }}
                            {% endfor %}
                        {% endif %}

                {% endfor %}

        {% endfor %}

```

---

The `Day` object
----------------

[](#the-day-object)

Every cell is a readonly value object:

```
$day->date      // DateTimeImmutable
$day->ghost     // belongs to adjacent month (grid padding, Monthly only)
$day->today     // matches today's date
$day->enabled   // not disabled by any rule
$day->data      // ?array — whatever your DayDataLoaderInterface returned
```

---

Calendar types
--------------

[](#calendar-types)

```
Calendar::forMonth(2024, 11)                         // full month, aligned to complete weeks
Calendar::forWeek(new DateTimeImmutable('2024-11-04')) // one week, Mon–Sun
Calendar::forToday(CalendarType::WorkWeek)           // this week, Mon–Fri
```

Or with navigation:

```
$next = $calendar->nextPeriod(); // next month / next week — depends on type
$prev = $calendar->prevPeriod();
```

---

Disable and enable days
-----------------------

[](#disable-and-enable-days)

Three independent layers — see [docs/disable-model.md](docs/disable-model.md) for the full model.

```
$calendar = Calendar::forMonth(2024, 11)
    ->disableDaysByName(DayName::Saturday, DayName::Sunday)  // structural — survives navigation
    ->disableDays(new DateTimeImmutable('2024-11-11'))        // date-specific — resets on navigation
    ->enableDays(new DateTimeImmutable('2024-11-30'));        // exception — override for one date
```

---

Further reading
---------------

[](#further-reading)

TopicFileDisable / enable model (three layers)[docs/disable-model.md](docs/disable-model.md)Attaching custom data to days[docs/data-loading.md](docs/data-loading.md)Navigation, caching, CalendarConfig[docs/navigation.md](docs/navigation.md)Recurring events (RFC 5545 RRULE)[docs/recurrence.md](docs/recurrence.md)iCal import and export[docs/ical.md](docs/ical.md)Resource calendar (rooms, people, vehicles)[docs/resource-calendar.md](docs/resource-calendar.md)Booking system pattern[docs/booking-mode.md](docs/booking-mode.md)---

Running tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

CI runs across PHP 8.2–8.5 on every push.

---

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance80

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~198 days

Total

4

Last Release

21d ago

Major Versions

1.1.0 → v2.0.0-beta.12026-06-30

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.1.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11459248?v=4)[Jozef Môstka](/maintainers/tito10047)[@tito10047](https://github.com/tito10047)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tito10047-php-callendar/health.svg)

```
[![Health](https://phpackages.com/badges/tito10047-php-callendar/health.svg)](https://phpackages.com/packages/tito10047-php-callendar)
```

###  Alternatives

[stefanbauer/ignition-laracasts-tab

A tab to retrieve laracasts.com answers

5311.5k](/packages/stefanbauer-ignition-laracasts-tab)

PHPackages © 2026

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