Download the PHP package melakudemeke/kenat-php without Composer
On this page you can find all versions of the php package melakudemeke/kenat-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download melakudemeke/kenat-php
More information about melakudemeke/kenat-php
Files in melakudemeke/kenat-php
Package kenat-php
Short Description A modern PHP library for the Ethiopian calendar: date conversion, formatting, arithmetic, calendar grids, and a full Bahire Hasab implementation.
License MIT
Homepage https://www.kenat.systems/
Informations about the package kenat-php
Kenat PHP / ቀናት
A modern PHP library for the Ethiopian calendar: bidirectional Ethiopian ↔ Gregorian date conversion, Amharic/English/Geez formatting, date arithmetic, calendar grid generation, and a full Bahire Hasab (ባሕረ ሃሳብ) implementation for computing movable religious holidays and fasting periods.
This is a PHP port of kenat (the JavaScript/TypeScript
original), sharing the same holiday data, Bahire Hasab algorithm, and API shape — adapted to
idiomatic, typed, modern PHP (PHP 8.1+, PSR-4, immutable value objects, zero runtime dependencies).
Features
- Bidirectional conversion between Ethiopian and Gregorian calendars.
- Calendar preference: read or format any date as Ethiopian or Gregorian.
- Complete holiday system: public, religious (Christian & Muslim), and cultural holidays, filterable by tag.
- Bahire Hasab (ባሕረ ሃሳብ): the traditional algorithm for movable feasts and fasts.
- Localized formatting: Amharic and English, including Geez numerals.
- Full date arithmetic: add/subtract days, months, years across the 13-month calendar.
- Start/end of period, date comparison, distance/diff helpers.
- Ethiopian time: 12-hour day/night time system, with conversion to/from Gregorian 24-hour time.
- Calendar grid generation: month/year grids with holiday and Orthodox saints-day overlays.
- Fasting periods: Lent, Nineveh, Ramadan, and more.
- Immutable & chainable: every method that changes a date returns a new
Kenatinstance. - Zero runtime dependencies.
Installation
Requires PHP 8.1 or later.
Quick Start
Date Conversion
Holidays & Bahire Hasab
Date Arithmetic & Comparison
Calendar Grid Generation
Ethiopian Time
Fasting Periods
Design Notes
- Value objects, not arrays:
EthiopianDate,GregorianDate,Holiday,DateRange, andDiffBreakdownare immutable, typed,JsonSerializablevalue objects rather than loose associative arrays, so IDEs and static analysis can follow the data through the API. - Static utility classes (
Conversions,DayArithmetic,Formatting,GeezConverter,Holidays,BahireHasab,Fasting,Utils) operate on those value objects — mirroring the original library's "pure functions operate on plain dates;Kenatis a thin stateful wrapper" architecture. - Islamic calendar dates (Eid al-Fitr, Eid al-Adha, Moulid, Ramadan) are computed with a
self-contained tabular Islamic calendar (Julian-Day-Number based), since PHP has no built-in
equivalent to the JS original's ICU
islamiccalendar binding without requiringext-intl. This can disagree with observation-based Islamic calendars by a day at some month boundaries — a known, accepted limitation, consistent with the project's other ports. - Orthodox saints data (
resources/nigs.json) is copied verbatim from the upstreamkenatproject and consumed byMonthGridin'christian'mode.
Testing
License
MIT — see LICENSE.
Related Projects
kenat— the original JavaScript/TypeScript library.kenat_py— Python port.kenat-dart— Dart port.
All versions of kenat-php with dependencies
ext-json Version *