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.