eliasdebelo/ethiopian-calendar
Composer 安装命令:
composer require eliasdebelo/ethiopian-calendar
包简介
Ethiopian ↔ Gregorian calendar conversion
README 文档
README
A modern, lightweight PHP library for seamless conversion between Ethiopian and Gregorian calendars. Ideal for applications serving Ethiopian users, historical calculations, and multicultural systems.
✨ Features
- 🔄 Bidirectional Conversion --- Ethiopian ↔ Gregorian\
- 📅 Real-time Date Handling --- Get current dates in both calendars\
- ✅ Robust Validation --- Clear error messages for invalid dates\
- 🎯 Leap Year Support --- Accurate handling of Pagume 5/6 days\
- 🚀 High Performance --- Zero dependencies, optimized calculations\
- 💪 Type Safe --- PHP 8.0+ with strict type declarations\
- 🧪 Fully Tested --- PHPUnit test coverage included\
- 🌍 English Month Names --- Avoid encoding issues
📦 Installation
composer require eliasdebelo/ethiopian-calendar
🚀 Quick Start
<?php require_once 'vendor/autoload.php'; use EliasDebelo\EthiopianCalendar\EthiopianCalendar; // Ethiopian → Gregorian echo EthiopianCalendar::toGregorian(2015, 4, 25); // "2024-01-03" // Gregorian → Ethiopian print_r(EthiopianCalendar::toEthiopian(2022, 3, 25)); // [2013, 7, 16] // Today's dates print_r(EthiopianCalendar::todayEthiopian()); echo EthiopianCalendar::todayGregorian(); // Format Ethiopian date echo EthiopianCalendar::format(2015, 1, 1, 'j M Y'); // "1 Meskerem 2015" // Leap year check echo EthiopianCalendar::isLeapYear(2015) ? 'Leap year' : 'Not leap year';
📚 API Reference
Conversion Methods
toGregorian(int $year, int $month, int $day): string\toEthiopian(int $year, int $month, int $day): array
Utilities
todayEthiopian(): array\todayGregorian(): string\format(int $year, int $month, int $day, string $format = "Y-m-d"): string\getDaysInMonth(int $year, int $month): int\getMonthName(int $month): string\isLeapYear(int $year): bool\isValidEthiopianDate(int $year, int $month, int $day): bool\getEthiopianNewYear(int $gregorianYear): array\getEthiopianNewYearDay(int $gregorianYear): int
🗓️ Ethiopian Calendar Structure
Month English Name Days Gregorian Equivalent
1 Meskerem 30 Sep--Oct 2 Tikimit 30 Oct--Nov 3 Hidar 30 Nov--Dec 4 Tahsas 30 Dec--Jan 5 Tir 30 Jan--Feb 6 Yekatit 30 Feb--Mar 7 Megabit 30 Mar--Apr 8 Miyazya 30 Apr--May 9 Ginbot 30 May--Jun 10 Sene 30 Jun--Jul 11 Hamle 30 Jul--Aug 12 Nehase 30 Aug--Sep 13 Pagume 5/6* Sep
*Pagume has 5 days in common years, 6 days in leap years.
🧪 Running Tests
composer install vendor/bin/phpunit --testdox vendor/bin/phpunit --coverage-html coverage
🔧 Requirements
- PHP 8.0+\
- Composer
📄 License
MIT License --- Open source.
🤝 Contributing
- Fork the repo\
- Create a branch (
git checkout -b feature/awesome)\ - Commit changes (
git commit -m "Add feature")\ - Push (
git push origin feature/awesome)\ - Open a Pull Request
🐛 Issues & Support
- Repo: GitHub\
- Issues: GitHub Issues\
- Email: eliascs2012@gmail.com\
- Packagist: https://packagist.org/packages/eliasdebelo/ethiopian-calendar
eliasdebelo/ethiopian-calendar 适用场景与选型建议
eliasdebelo/ethiopian-calendar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eliasdebelo/ethiopian-calendar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eliasdebelo/ethiopian-calendar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-13