Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/nahombehailu22/ethiopian-calendar-date/archive/refs/heads/main.zipA WordPress block that shows a date in the Ethiopian calendar, in Amharic or English.
ኅዳር 9 ቀን 2019 ዓ.ም. Hidar 9, 2019 E.C. (18 November 2026)
It can show the post's publish date, today's date in the site's time zone, or a fixed date, with the day of the week and the Gregorian date as options. It works inside the Query Loop.
How it is built
- Rendered on the server.
block/render.phpconverts the date when the page is built. Visitors download no JavaScript for this block, which matters on slow or metered connections. The output is a<time datetime="YYYY-MM-DD">element with alangattribute. - No build step.
block/editor.jsuses thewp.*globals directly, so the code in the repository is the code that runs. - One algorithm, two languages. Both calendars are mapped to the Julian Day Number and converted through it.
includes/class-converter.phpdoes this for the page andblock/converter.jsdoes it for the editor preview.
Tests
The PHP and JavaScript versions are tested against the same file, tests/fixtures/known-dates.json, so they cannot drift apart. Its values were computed by counting days from Enkutatash 2016 (12 September 2023), a method separate from the plugin's arithmetic. The holiday rows were also checked against published 2026 holiday calendars:
| Gregorian | Ethiopian | Occasion |
|---|---|---|
| Sun 1 March 1896 | Yekatit 23, 1888 | Battle of Adwa |
| Mon 11 September 2023 | Pagume 6, 2015 | Sixth day of Pagume, leap years only |
| Wed 7 January 2026 | Tahsas 29, 2018 | Genna |
| Mon 19 January 2026 | Tir 11, 2018 | Timket |
| Fri 11 September 2026 | Meskerem 1, 2019 | Enkutatash |
| Sun 12 September 2027 | Meskerem 1, 2020 | Enkutatash, the year before a Gregorian leap year |
Both suites also walk every day from 1 January 1900 to 31 December 2100 and check that the Ethiopian date advances by exactly one day, rolls over months and years only where it should, and round-trips back to the same day. The PHP suite also tests the rendered markup, the site time zone and the handling of bad input.
composer update && vendor/bin/phpunit
npm ci && npm test
CI runs PHPUnit on PHP 7.4, 8.1 and 8.3, and Jest on Node 20.
License
GPL-2.0-or-later.