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

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

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

Php server side rendered calendar

1.0.0(1y ago)054↓100%PHPPHP &gt;=8.1CI failing

Since Nov 29Pushed 2mo 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 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

[![PHP Tests](https://github.com/tito10047/php-calendar/actions/workflows/symfony.yml/badge.svg)](https://github.com/tito10047/php-calendar/actions/workflows/symfony.yml)

Plain PHP Calendar Package
==========================

[](#plain-php-calendar-package)

This package provides a simple calendar component that can be used in PHP applications.

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

[](#installation)

To install the package, use the following commands:

### Using Composer

[](#using-composer)

```
composer require tito10047/php-callendar
```

Usage
-----

[](#usage)

### In PHP

[](#in-php)

To use the calendar component in your PHP application, include the autoload file and instantiate the calendar class.

```
require 'vendor/autoload.php';

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

$calendar = new Calendar(
    date:new DateTime('2021-01-01'),
    daysGenerator:CalendarType::Monthly,
    startDay:DayName::Monday
);
$nextMonthCalendar = $calendar->nextMonth();
$renderer = Renderer::factory(CalendarType::Monthly,'calendar');

$calendar->disableDays(new DateTime('2021-01-01'));
$calendar->disableDaysByName(DayName::Sunday);
$nextMonthCalendar->disableDaysByName(DayName::Sunday);

echo $renderer->render($calendar);
echo $renderer->render($nextMonthCalendar);
```

### In Twig

[](#in-twig)

To use the calendar component in your Twig template, include the calendar template and pass the calendar object to the template.

```
use Tito10047\Calendar\Calendar;
$calendar = new Calendar(
    date:new DateTime('2021-01-01'),
    daysGenerator:CalendarType::Monthly,
    startDay:DayName::Monday
);
$table = $calendar->getDaysTable();
```

```

{%for weekNum,week in table%}

        {%for dayNum,day in week%}
            {% set classes = 'day' %}
            {% if day.today %}{% set classes = classes ~ ' today' %}{% endif %}
            {% if not day.enabled %}{% set classes = classes ~ ' disabled' %}{% endif %}

                {% if not day.ghost %}
                    {{day.date|format('d')}}
                {%endif%}

        {%endfor%}

{%endfor%}

```

### Custom Days Generator

[](#custom-days-generator)

You can create your own days generator by implementing the `DaysGeneratorInterface` interface.

```
use Tito10047\Calendar\Interface\DaysGeneratorInterface;

class CustomDaysGenerator implements DaysGeneratorInterface
{
    public function getDays(\DateTimeImmutable $day, DayName $firstDay):array
    {
        // Your custom logic here
    }
}

$calendar = new Calendar(
    date:new DateTime('2021-01-01'),
    daysGenerator:new CustomDaysGenerator(),
    startDay:DayName::Monday
);
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance66

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

526d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d6d558226302620ec462f64672e9dc81609227626923a808005641e76e8c38f?d=identicon)[tito10047](/maintainers/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)
```

PHPackages © 2026

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