PHPackages                             breadthe/php-simple-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. breadthe/php-simple-calendar

ActiveLibrary

breadthe/php-simple-calendar
============================

Generates a monthly array of dates for displaying in a calendar grid

v1.1.0(4y ago)76.9k↓100%11MITPHPPHP ^7.3|^7.4|^8.0

Since Mar 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/breadthe/php-simple-calendar)[ Packagist](https://packagist.org/packages/breadthe/php-simple-calendar)[ Docs](https://github.com/breadthe/php-simple-calendar)[ RSS](/packages/breadthe-php-simple-calendar/feed)WikiDiscussions master Synced 1mo ago

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

🗓 PHP Simple Calendar
=====================

[](#-php-simple-calendar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/89a63586762b6953f6d0d82950200205ad9a2ff4979abd0c58403ed34a79f054/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62726561647468652f7068702d73696d706c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/breadthe/php-simple-calendar)[![Build Status](https://camo.githubusercontent.com/7e62caf9e44be5735e3b49ed78dddd773de6fcc501756c94a9a6fca5a2143735/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62726561647468652f7068702d73696d706c652d63616c656e6461722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/breadthe/php-simple-calendar)[![Quality Score](https://camo.githubusercontent.com/731259714aa59acc4e0336501156bd6268ccf0a26f794bf5eeaf0e4934dfef50/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f62726561647468652f7068702d73696d706c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/breadthe/php-simple-calendar)[![Total Downloads](https://camo.githubusercontent.com/5c59c27571fed18a052e3c49a2fcad1ccd2108b87b6c3b2099a7b062367c9a2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62726561647468652f7068702d73696d706c652d63616c656e6461722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/breadthe/php-simple-calendar)

This PHP 7.3+ package generates a 7 x 6 (42) or 7 x 5 (35) element array of the days of the month for the desired date. Each date is an instance of `Carbon\Carbon`.

It automatically pads the beginning/end of the month with dates from the previous/next month. It can optionally pad with `null` instead.

While it does not include an UI, you may use the generated matrix to build a month-grid calendar in the front-end technology of your choice.

**NOTE** For now, at least, weeks start with Monday.

Requirements
------------

[](#requirements)

- PHP 7.3+

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

[](#installation)

You can install the package via composer:

```
composer require breadthe/php-simple-calendar
```

Usage
-----

[](#usage)

### Calendar grid generation

[](#calendar-grid-generation)

```
use Breadthe\SimpleCalendar\Calendar;

$date = '2020-03-24'; // ISO date

$calendar = new Calendar($date);
$currentMonth = $calendar->grid();

// or use the static constructor
$currentMonth = Calendar::make($date)->grid();
```

### Start of previous/next months

[](#start-of-previousnext-months)

The start (first day) of the previous and next months is a convenience that might come in handy when building the "previous month"/"next month" navigation in a calendar UI. These properties will exist even if `padWithNull()` is called.

```
$date = '2020-03-17';
$currentMonth = Calendar::make($date);

$currentMonth->startOfPrevMonth; // get the start of the previous month - instance of Carbon
$currentMonth->startOfPrevMonth->toDateString(); // '2020-02-01'

$currentMonth->startOfNextMonth; // get the start of the previous month - instance of Carbon
$currentMonth->startOfNextMonth->toDateString(); // '2020-04-01'
```

### UI Example

[](#ui-example)

Here's an example of a simple calendar UI that can be built with this package.

[![Simple calendar UI](https://user-images.githubusercontent.com/17433578/77709612-ae1c6f80-6f99-11ea-84cb-a7eeba1d0244.png)](https://user-images.githubusercontent.com/17433578/77709612-ae1c6f80-6f99-11ea-84cb-a7eeba1d0244.png)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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)

- [breadthe](https://github.com/breadthe)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel/PHP Package Boilerplate
-------------------------------

[](#laravelphp-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

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

Every ~758 days

Total

2

Last Release

1477d ago

PHP version history (2 changes)1.0.0PHP ^7.3|^7.4

v1.1.0PHP ^7.3|^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/555692bc62844933d570637ec8f699ec25755e0d2b101dc0eee8370f66bc9916?d=identicon)[breadthe](/maintainers/breadthe)

---

Top Contributors

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

---

Tags

phpcalendarphp calendarbreadthephp-simple-calendarsimple calendar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/breadthe-php-simple-calendar/health.svg)

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

###  Alternatives

[garethp/php-ews

A PHP Library to interact with the Exchange SOAP service

113610.3k4](/packages/garethp-php-ews)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

9230.2k4](/packages/bitrix24-b24phpsdk)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)[limingxinleo/hyperf-utils

Utils for Hyperf.

29133.9k3](/packages/limingxinleo-hyperf-utils)[davaxi/vcalendar

PHP Class to generate VCalendar (ics) file

1180.8k](/packages/davaxi-vcalendar)

PHPackages © 2026

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