Logo Lanfrica

kashumaku/Ethiopian-calendar

Domain:

natural language processing

Record type:

software
Creator:
kas
Host:
# Ethiopian Calendar A lightweight TypeScript/JavaScript utility for converting between the **Gregorian calendar** and the **Ethiopian calendar**, with support for Ethiopian date formatting in English and Amharic. ## Repository The source code, documentation, and issue tracker are available on GitHub. GitHub Repository ## Features * Gregorian → Ethiopian date conversion * Ethiopian → Gregorian date conversion * Get today's Ethiopian date * Ethiopian leap-year detection * Ethiopian date validation * Ethiopian date formatting * English month names * Amharic month names * English and Amharic weekday names * Zero runtime dependencies * TypeScript support * Works with JavaScript, TypeScript, React, React Native, and Expo ## Installation ### npm ```bash npm install @kashumaku/ethio-calendar ``` ### Yarn ```bash yarn add @kashumaku/ethio-calendar ``` ## Usage ### Gregorian to Ethiopian ```ts import { gregorianToEthiopian } from "@kashumaku/ethio-calendar" const date = new Date(2026, 7, 12) const ethiopianDate = gregorianToEthiopian(date) console.log(ethiopianDate) ``` Result: ```ts { year: 2018, month: 12, day: 5 } ``` The returned object has the following structure: ```ts interface EthiopianDate { year: number month: number day: number } ``` --- ## Ethiopian to Gregorian ```ts import { ethiopianToGregorian } from "@kashumaku/ethio-calendar" const date = ethiopianToGregorian( 2018, 12, 5, ) console.log(date) ``` The result is a native JavaScript `Date` object. --- ## Get Today's Ethiopian Date ```ts import { todayEthiopian } from "@kashumaku/ethio-calendar" const today = todayEthiopian() console.log(today) ``` Example: ```ts { year: 2018, month: 12, day: 5 } ``` --- # Formatting The `formatEthiopian()` function can convert a JavaScript `Date` or an `EthiopianDate` into a formatted Ethiopian date. ```ts import { formatEthiopian } from "@kashumaku/ethio-calendar" const date = new Date() console.log( formatEthiopian(date) ) ``` Default …

Languages