UNPKG

ethioholiday

Version:

A comprehensive Ethiopian holidays calculator that works with both Ethiopian and Gregorian calendar systems

222 lines (91 loc) 3.84 kB
markdown # EthioHoliday 🇪🇹 [![npm version](https://img.shields.io/npm/v/ethioholiday.svg)](https://www.npmjs.com/package/ethioholiday) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) A complete Ethiopian holiday calculator that provides accurate dates for all Ethiopian public holidays, religious festivals, and special occasions in both Ethiopian and Gregorian calendars. ## Features ✨ - 📅 **Complete holiday list** - All official Ethiopian public holidays - ⏳ **Future-proof** - Works for any year (past, present, or future) - 🔄 **Auto-conversion** - Provides dates in both Ethiopian and Gregorian systems - 🎯 **Accurate calculations** - Proper handling of movable holidays like Fasika - 📦 **Lightweight** - Zero dependencies (except Ethiopian calendar converter) ## Installation ### npm ```bash npm install ethioholiday ``` yarn ```bash yarn add ethioholiday ``` ## Basic Usage ### Get all holidays for a year ```jsx import { getEthiopianHolidays } from 'ethioholiday'; // Get holidays for Ethiopian year 2034 const holidays2034 = getEthiopianHolidays(2034); holidays2034.forEach(holiday => { console.log(`${holiday.name}: Ethiopian: ${holiday.ethiopianDate.year}/${holiday.ethiopianDate.month}/${holiday.ethiopianDate.day} Gregorian: ${holiday.gregorianDate.year}/${holiday.gregorianDate.month}/${holiday.gregorianDate.day} ${holiday.isPublicHoliday ? '(Public Holiday)' : ''} `); }); ``` ### Get specific holidays ```jsx // Get current year's holidays const currentEthYear = 2016; // Example - use toEthiopian() for dynamic year const holidays = getEthiopianHolidays(currentEthYear); const enkutatash = holidays.find(h => h.name.includes('Enkutatash')); const fasika = holidays.find(h => h.name.includes('Fasika')); console.log('New Year:', enkutatash); console.log('Easter:', fasika); ``` ### Complete Holiday List The package returns these official holidays: Fixed Date Holidays Holiday Ethiopian Date Enkutatash (New Year) Meskerem 1 Meskel Meskerem 17 Genna (Christmas) Tahsas 29 Timket (Epiphany) Tir 11 Victory of Adwa Yekatit 23 Patriots' Victory Day Miazia 27 Downfall of Derg Ginbot 20 National Day Sene 20 Movable Holidays Fasika (Ethiopian Easter) - Calculated annually Siklet (Good Friday) - 2 days before Fasika Eid al-Fitr - Approximate Islamic date Eid al-Adha - Approximate Islamic date ### API Reference ```jsx getEthiopianHolidays(year: number): Holiday[] Parameter: year: Ethiopian calendar year (1-9999) Returns an array of Holiday objects with: typescript { name: string; // Holiday name ethiopianDate: { // Ethiopian date year: number; month: number; // 1-13 (13 = Pagume) day: number; }; gregorianDate: { // Gregorian date year: number; month: number; // 1-12 day: number; }; isPublicHoliday: boolean; // True for official public holidays } ``` ### 🤝 Contributing Contributions, issues, and feature requests are welcome! Feel free to check the issues page or open a pull request. ### 📄 License This project is licensed under the MIT License - see the LICENSE file for details. ### 🙏 Acknowledgments Calculations based on the Ethiopian calendar system. Thanks to all contributors who help maintain this package. Made with ❤️ for the Ethiopian developer community.