PHPackages                             achristodoulou/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. achristodoulou/calendar

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

achristodoulou/calendar
=======================

A package that provides easy access to calendar functionality.

v1.0.0(10y ago)028MITPHP

Since Nov 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/achristodoulou/calendar)[ Packagist](https://packagist.org/packages/achristodoulou/calendar)[ RSS](/packages/achristodoulou-calendar/feed)WikiDiscussions master Synced 2mo ago

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

Calendar
========

[](#calendar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7517997bb64085a0e30443f44f0f3f8c90fc9896f7356c3dcfb3f5bcfe66b602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616368726973746f646f756c6f752f63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/achristodoulou/calendar)[![Build Status](https://camo.githubusercontent.com/416906eed35be6c94e089c81894b6163b17661a7d9226718c14e7934d28040fe/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616368726973746f646f756c6f752f63616c656e6461722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/achristodoulou/calendar)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package can be used for any calendar related queries. For example you can check if today is a specific date, if is public holidays, is working day, is working hours, is lunch time, is Christmas any many more.

Install
-------

[](#install)

Via Composer

```
$ composer require achristodoulou/calendar
```

Usage
-----

[](#usage)

```
use \Achristodoulou\Calendar\Day;
use \Achristodoulou\Calendar\ListOfDates;
use \Achristodoulou\Calendar\TimeRange;
use \Achristodoulou\Calendar\TwentyFourHourTime;
use \Achristodoulou\Calendar\Today;

$currentTime = new DateTime();

$workingHours = new TimeRange(new TwentyFourHourTime('08:00'), new TwentyFourHourTime('18:00'));

$publicHolidays = new ListOfDates();
$publicHolidays->add(new DateTime('2015-01-18'));

$annualLeave = new ListOfDates();
$annualLeave->add(new DateTime('2015-07-30'));

$lunchTime = new TimeRange(new TwentyFourHourTime('12:00'), new TwentyFourHourTime('01:00'));

$today = new Today($currentTime, $workingHours, $publicHolidays, $annualLeave, $lunchTime);

echo "\nToday is Thursday: "                . ($today->is(Day::THURSDAY)          ? 'yes' : 'no');
echo "\nToday is Assumption Day: "          . ($today->isAssumptionDay()          ? 'yes' : 'no');
echo "\nToday is Public Holiday: "          . ($today->isPublicHoliday()          ? 'yes' : 'no');
echo "\nNow is After Working Hours: "       . ($today->isAfterWorkingHour()       ? 'yes' : 'no');
echo "\nToday I am on Annual Leave: "       . ($today->isAnnualLeave()            ? 'yes' : 'no');
echo "\nToday is Annunciation Day: "        . ($today->isAnnunciationDay()        ? 'yes' : 'no');
echo "\nToday is Christmas Day: "           . ($today->isChristmas()              ? 'yes' : 'no');
echo "\nToday is Epiphany Day: "            . ($today->isEpiphanyDay()            ? 'yes' : 'no');
echo "\nToday is Labour Day: "              . ($today->isLabourDay()              ? 'yes' : 'no');
echo "\nNow is Lunch Time: "                . ($today->isLunchTime()              ? 'yes' : 'no');
echo "\nToday is Midnight Of Working Day: " . ($today->isMidnightOfWorkingDay()   ? 'yes' : 'no');
echo "\nToday is New Year Day: "            . ($today->isNewYearDay()             ? 'yes' : 'no');
echo "\nToday is Noon of Working Day: "     . ($today->isNoonOfWorkingDay()       ? 'yes' : 'no');
echo "\nToday is Weekend: "                 . ($today->isWeekend()                ? 'yes' : 'no');
echo "\nToday is Working Day: "             . ($today->isWorkingDay()             ? 'yes' : 'no');
echo "\nNow is Working Hour: "              . ($today->isWorkingHour()            ? 'yes' : 'no');
```

Output:

```
Today is Thursday: yes
Today is Assumption Day: no
Today is Public Holiday: no�
Now is After Working Hours: yes
Today I am on Annual Leave: no
Today is Annunciation Day: no
Today is Christmas Day: no
Today is Epiphany Day: no
Today is Labour Day: no
Now is Lunch Time: no
Today is Midnight Of Working Day: no
Today is New Year Day: no
Today is Noon of Working Day: no
Today is Weekend: no
Today is Working Day: yes
Now is Working Hour: no

```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- \[Andreas Christodoulou\]

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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

3820d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/995b86856d488aa2eea28356e3c71b028968c1a89c5abdd713c97811c9ef10a7?d=identicon)[achristodoulou](/maintainers/achristodoulou)

---

Top Contributors

[![andreas22](https://avatars.githubusercontent.com/u/1688197?v=4)](https://github.com/andreas22 "andreas22 (4 commits)")[![achristodoulou](https://avatars.githubusercontent.com/u/7711124?v=4)](https://github.com/achristodoulou "achristodoulou (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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