Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ethiopian-calendar-new

yaredabebe490MIT1.0.8TypeScript support: included

Convert between Ethiopian and Gregorian calendars easily. Provides accurate conversions between dates in the Ethiopian and Gregorian calendars.

ethiopian, ethiopia-calender, ethiopian-calender, calendar, date, converter, ethiopic, Ethiopia, Amharic, calendar-converter

readme

markdown

Ethiopian Calendar Converter 🇪🇹

npm version License: MIT

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

Using npm or yarn:

`bash npm install ethiopian-calendar-new

or

yarn add ethiopian-calendar-new

🚀 Usage

Importing

You can use either ES Modules or CommonJS: ES Modules (recommended):

short snippet

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): 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 }

//or

📘 API

toGregorian(year, month, day) → converts Ethiopian → Gregorian

toEthiopian(year, month, day) → converts Gregorian → Ethiopian

🙏 Acknowledgments

Calculations based on the Ethiopian calendar system.