Logo Lanfrica

yaredabebe/ethiopian-calendar

Record type:

software
Creator:
yar
Host:
markdown # Ethiopian Calendar Converter πŸ‡ͺπŸ‡Ή A lightweight and accurate JavaScript/TypeScript library to convert dates between the **Gregorian** and **Ethiopian** calendar systems. It handles leap years and the unique 13th month (*PagumΔ“*) of the Ethiopian calendar. --- ## πŸ“¦ Installation Install using your preferred package manager. Using **npm** or **yarn**: ## npm ```bash npm install ethiopian-calendar-new ``` ## yarn ```bash yarn add ethiopian-calendar-new ``` ## πŸš€ Usage Importing You can use either ES Modules or CommonJS: ES Modules (recommended): ## short snippet ```jsx import { toGregorian, toEthiopian } from 'ethiopian-calendar-new'; // Ethiopian to Gregorian console.log(toGregorian(2017, 11, 19)); // ➜ { year: 2025, month: 7, day: 26 } // Gregorian to Ethiopian console.log(toEthiopian(2025, 7, 26)); // ➜ { year: 2017, month: 11, day: 19 } ``` ## import and CommonJS require syntax CommonJS (Node.js): ```jsx const { toGregorian, toEthiopian } = require('ethiopian-calendar-new'); πŸ”„ Convert Ethiopian β†’ Gregorian const ethiopianDate = { year: 2017, month: 1, day: 1 }; const gregorian = toGregorian(ethiopianDate.year, ethiopianDate.month, ethiopianDate.day); console.log(gregorian); // { year: 2024, month: 9, day: 11 } ``` ## πŸ“˜ API ```jsx toGregorian(year, month, day) β†’ converts Ethiopian β†’ Gregorian toEthiopian(year, month, day) β†’ converts Gregorian β†’ Ethiopian ``` πŸ™ Acknowledgments Calculations based on the Ethiopian calendar system.

Languages