bekim2121 / ethiopian-datepicker
A professional, accurate Ethiopian (Ge'ez) calendar date picker with bilingual support (Amharic/English), dark mode, and holiday highlighting
Package info
github.com/Bereketmuniye/date-picker-for-ethiopian
Language:HTML
pkg:composer/bekim2121/ethiopian-datepicker
Requires
- php: >=7.4
- ext-calendar: *
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2026-04-16 11:45:46 UTC
README
A professional Ethiopian calendar date and time picker with accurate Gregorian ↔ Ethiopian conversion. Pure JavaScript, zero dependencies.
Features
✅ Tiered Navigation (Year → Month → Day) • ✅ Age Calculation • ✅ Accurate conversion • 🌍 Bilingual (Amharic/English) • 🌅 Native Ethiopian Time (6h offset) • 🌙 Dark mode • 🎉 Holiday highlighting • ⌨️ Keyboard navigation • ♿ Accessible • 📱 Responsive
Installation
JavaScript (NPM):
npm install @bekim_2121/ethiopian-datepicker
PHP (Composer):
composer require bekim2121/ethiopian-datepicker
JavaScript (CDN):
<!-- Replace VERSION with the latest version (e.g., 1.1.5) --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@bekim_2121/ethiopian-datepicker@VERSION/dist/ethiopian-datepicker.css"> <script src="https://cdn.jsdelivr.net/npm/@bekim_2121/ethiopian-datepicker@VERSION/dist/ethiopian-datepicker.js"></script>
Quick Start
JavaScript Usage
<!-- Input element --> <input type="text" id="datepicker" placeholder="ቀን ይምረጡ..." readonly> <script> // Initialize Date Picker new EthiopianDatePicker('#datepicker', { locale: 'am', // 'am' or 'en' darkMode: false }); </script>
PHP Usage
<?php require 'vendor/autoload.php'; use EthiopianDatePicker\EthiopianDatePicker; // Get current Ethiopian date $today = EthiopianDatePicker::today(); echo "Today: " . EthiopianDatePicker::formatDate($today, 'amharic', 'long') . "\n"; // Convert Gregorian to Ethiopian $ethiopianDate = EthiopianDatePicker::gregorianToEthiopian(2023, 9, 11); echo "Ethiopian date: " . EthiopianDatePicker::formatDate($ethiopianDate, 'english', 'long') . "\n"; // Convert Ethiopian to Gregorian $gregorianDate = EthiopianDatePicker::ethiopianToGregorian(2016, 1, 1); echo "Gregorian date: " . implode('-', $gregorianDate) . "\n";
Special Features
📅 Tiered Navigation (New!)
Skip the "tired" month-by-month clicking.
- Click the Year to select from a grid.
- Click the Month to jump to any Ethiopian month.
- Selecting a year automatically prompts for the month.
🎂 Age Calculation
Accurately calculate age in Ethiopian years, months, and days, correctly handling Pagume (the 13th month).
const calendar = new EthiopianCalendar(); const age = calendar.calculateAge(2010, 5, 4); // Returns: { years: 7, months: 6, days: 10 }
Configuration
JavaScript Configuration
new EthiopianDatePicker('#input', { locale: 'am', // Language ('am' or 'en') darkMode: false, // Dark mode theme highlightHolidays: true, // Highlight Ethiopian holidays minDate: new Date(), // Disable previous dates maxDate: new Date('2030-12-31'), // Max selectable date onChange: (date) => { console.log('Ethiopian:', date.ethiopian); console.log('Gregorian:', date.gregorian); console.log('Formatted:', date.formatted); } });
PHP Configuration
The PHP library doesn't require configuration - it's ready to use after installation:
<?php require 'vendor/autoload.php'; use EthiopianDatePicker\EthiopianDatePicker; // All methods are static - no instantiation needed $today = EthiopianDatePicker::today(); // Format options $date = [2016, 1, 1]; // Different language formats echo EthiopianDatePicker::formatDate($date, 'amharic', 'long'); // "1 መስከረም 2016" echo EthiopianDatePicker::formatDate($date, 'english', 'long'); // "1 Meskerem 2016" echo EthiopianDatePicker::formatDate($date, 'amharic', 'short'); // "2016-1-1" echo EthiopianDatePicker::formatDate($date, 'english', 'short'); // "2016-1-1" // Get month names $amharicMonths = EthiopianDatePicker::getAmharicMonths(); $englishMonths = EthiopianDatePicker::getEnglishMonths();
Time Picker
new EthiopianTimePicker('#input', { useEthiopianTime: true, // Native 12h cycle (Sunrise = 12:00) twelveHour: true, // Day/Night labels (ረፋድ, ማታ, etc.) darkMode: false, onChange: (time) => console.log(time.ethiopian.formatted) });
API
JavaScript API
| Method | Description |
|---|---|
getSelectedDate() |
Returns the currently selected date object. |
setDate(y, m, d) |
Sets the date programmatically. |
open() / close() |
Manually control picker visibility. |
PHP API
| Method | Description |
|---|---|
gregorianToEthiopian($year, $month, $day) |
Convert Gregorian to Ethiopian date |
ethiopianToGregorian($year, $month, $day) |
Convert Ethiopian to Gregorian date |
today() |
Get current Ethiopian date |
formatDate($date, $language, $format) |
Format Ethiopian date for display |
isLeapYear($year) |
Check if Ethiopian year is leap year |
getAmharicMonths() |
Get month names in Amharic |
getEnglishMonths() |
Get month names in English |
Ethiopian Calendar Utilities
const calendar = new EthiopianCalendar(); // Convert dates const ethDate = calendar.gregorianToEthiopian(new Date()); const gregDate = calendar.ethiopianToGregorian(2017, 5, 4); // Format dates const formatted = calendar.formatDate(2017, 1, 1, 'am'); // "1 መስከረም 2017"
Ethiopian Holidays
The picker automatically highlights and labels major Ethiopian holidays:
- እንቁጣጣሽ (New Year)
- መስቀል (Finding of the True Cross)
- ገና (Christmas)
- ጥምቀት (Epiphany)
- አድዋ (Victory of Adwa)
- ፋሲካ (Easter)
- And more...
Browser Support
Chrome, Firefox, Safari, Edge (latest versions).
License
MIT © Bereket
Built with ❤️ for the Ethiopian community