Logo Lanfrica

abrhamtafere/Ethiopian-calendar-converter

Domaine:

natural language processing

Type de record:

softwaretools
Créateur:
abr
Hôte:
Ethiopian date converter # ethiopian-calendar-converter > High-performance, zero-dependency Ethiopian Calendar converter for TypeScript and JavaScript. Convert Gregorian dates to the Ethiopian (Ge'ez) Calendar and vice-versa with dual language support (Amharic & English), leap-year calculations, and high-speed $O(1)$ integer arithmetic. ## Features - ⚡ **High Performance** – Pure $O(1)$ mathematical conversion (~1 µs per operation). - 🌐 **Universal Compatibility** – Runs everywhere JS/TS executes (Node.js, Browsers, React, Vue, Next.js, React Native, Bun, Deno & Edge Functions). - 🔄 **Bidirectional** – Convert Gregorian $\rightarrow$ Ethiopian and Ethiopian $\rightarrow$ Gregorian. - 📦 **Zero Dependencies** – Lightweight and tree-shakeable. - 📘 **First-Class TypeScript** – Written in TypeScript with full type definitions included. - 🌍 **Localization** – Pre-packaged Amharic (አማርኛ) and English month names. ## Installation ```bash npm install ethiopian-calendar-converter # or yarn add ethiopian-calendar-converter # or pnpm add ethiopian-calendar-converter ``` ## Quick Start ### Basic Usage (TypeScript / ESM) ```typescript import { gregorianToEth, ethiopianToGregorian, toEthiopianDate, getCurrentEthiopian } from 'ethiopian-calendar-converter'; // Convert Gregorian to Ethiopian const eth = gregorianToEth('2026-08-31'); // { year: 2018, month: 12, day: 25, monthNameAm: 'ነሐሴ', monthNameEn: 'Nehase' } // Format as localized date string console.log(toEthiopianDate('2026-08-31', 'am')); // "25 ነሐሴ 2018" console.log(toEthiopianDate('2026-08-31', 'en')); // "25 Nehase 2018" // Convert Ethiopian to Gregorian (Inverse) const greg = ethiopianToGregorian(2018, 12, 25); // { year: 2026, month: 8, day: 31 } ``` ### Backend Example (Express / Node.js API) ```typescript import express from 'express'; import { gregorianToEth, toEthiopianDate } from 'ethiopian-calendar-converter'; const app = express(); app.get('/api/date-convert', (req, res) => { const date = (req.query.date as string) || ne …

Languages