PHPackages                             adiafora/hanke-henry-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. adiafora/hanke-henry-calendar

ActiveLibrary

adiafora/hanke-henry-calendar
=============================

PHP implementation of the Hanke-Henry Permanent Calendar

v1.0.0(1mo ago)00MITPHPPHP ^8.2CI passing

Since Mar 15Pushed 1mo agoCompare

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

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

Hanke-Henry Permanent Calendar (HHPC) for PHP
=============================================

[](#hanke-henry-permanent-calendar-hhpc-for-php)

[![Build Status](https://camo.githubusercontent.com/1733c150625d162575c52b14be56449c3ab377012b76f7bd6c63112d5daff771/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61646961666f72612f68616e6b652d68656e72792d63616c656e6461722f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/1733c150625d162575c52b14be56449c3ab377012b76f7bd6c63112d5daff771/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f61646961666f72612f68616e6b652d68656e72792d63616c656e6461722f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)[![PHP Version](https://camo.githubusercontent.com/02e302343a817543bc5a664ea12b8970d8afe683372c321f2efd065fef803efd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3737376262342e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/02e302343a817543bc5a664ea12b8970d8afe683372c321f2efd065fef803efd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3737376262342e7376673f7374796c653d666c61742d737175617265)[![Stan Level](https://camo.githubusercontent.com/2a230a76f359554bbf98ec8309a27ffb95e1aeeaf4f799d6e13acef0eb5da0ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d6c6576656c253230392d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](phpstan.neon)

A professional, immutable, and ISO 8601-compliant PHP library for working with the **Hanke-Henry Permanent Calendar**.

This library provides a robust engine to handle the unique structure of the HHPC, including the "Xtra" leap week (Mini-Month), fixed quarterly patterns, and seamless conversion between Gregorian and Hanke-Henry dates.

✨ Features
----------

[](#-features)

- **Immutable Architecture:** All date objects are immutable, ensuring thread safety and predictable behavior similar to `DateTimeImmutable`.
- **ISO 8601 Compliance:** Fully aligned with the ISO week date system. Every year starts on Monday, and the Xtra week handling respects the 53-week ISO cycle.
- **Xtra Week Support:** First-class support for the intercalary Xtra week (treated programmatically as Month 13).
- **Zero Dependencies:** Requires only native PHP extensions (`intl`).
- **Production Ready:** Fully typed (PHP 8.2+), tested, and analyzed with PHPStan (Level 9).

📦 Installation
--------------

[](#-installation)

```
composer require adiafora/hanke-henry-calendar
```

🚀 Quick Start
-------------

[](#-quick-start)

```
use Adiafora\Hhpc\HhpcDate;

// Create a date from Gregorian
$date = HhpcDate::fromGregorian(new \DateTimeImmutable('2026-03-27'));

echo $date->format('Y-m-d');
// Output: 2026-03-29

echo $date->addDays(3);
// 2026-04-01
```

### Handling the "Xtra" Week (Leap Year)

[](#handling-the-xtra-week-leap-year)

In the Hanke-Henry calendar, leap years (occurring every 5-6 years) include an extra 7-day week at the end of year. This library represents it as Month 13 for ease of calculation.

```
use Adiafora\Hhpc\HhpcDate;

// 2026 is a Leap Year in HHPC
$endOfYear = HhpcDate::create(2026, 12, 31); // Last day of regular December

$xtraWeek = $endOfYear->addDays();

echo $xtraWeek->format('Y-m-d');
// Output: 2026-13-01 (1st day of the Xtra week)

echo $xtraWeek->isXtra();
// Output: true
```

🧩 Core Entities
---------------

[](#-core-entities)

The package provides a rich set of immutable objects representing different components of the Hanke-Henry calendar. All entities are located in the `Adiafora\Hhpc\` namespace.

- **`HhpcDate`** — The primary object for working with precise dates, times, formatting, and comparisons.
- **`HhpcWeek`** — Represents a 7-day week, fully compatible with the ISO week numbering system.
- **`HhpcMonth`** — Represents a calendar month, handling the fixed 30-day/31-day lengths and the special 13th "Xtra" month.
- **`HhpcQuarter`** — Represents a 91-day fixed quarter (consisting of two 30-day months and one 31-day month).
- **`HhpcYear`** — Represents a specific calendar year and provides helpers to check its leap status.

📐 Architecture &amp; ISO 8601 Compliance
----------------------------------------

[](#-architecture--iso-8601-compliance)

The Hanke-Henry Permanent Calendar is designed to preserve the 7-day week cycle, making it uniquely compatible with the ISO 8601 week numbering system.

This library strictly adheres to these standards:

- **Week Start:** Every week, month, and year strictly begins on a Monday.
- **Year Definition:** The HHPC year matches the ISO week-numbering year.
- **Synchronization:** The library uses the "Thursday rule" (ISO 8601) to synchronize with the Gregorian calendar, ensuring that the 13th "Xtra" week perfectly aligns with the ISO 53rd week.

This means you can safely use this library in logistics, financial planning, and systems that rely on ISO week numbers.

🛠 Development
-------------

[](#-development)

We use Docker and a set of quality assurance tools to maintain high standards.

```
# Build docker container
make build

# Install the dependencies
make composer

# Run CI checks
make ci
```

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](https://github.com/adiafora/hanke-henry-calendar/blob/main/LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

58d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/adiafora-hanke-henry-calendar/health.svg)

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

PHPackages © 2026

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