@kashumaku/ethio-calendar
v1.0.4
Published
An Ethiopian Calendar library for JavaScript and TypeScript that provides reliable conversion between the Ethiopian and Gregorian calendars, date formatting, validation, and common calendar utilities. Built for developers who need to work with Ethiopian d
Maintainers
Keywords
Readme
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.
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
npm install @kashumaku/ethio-calendarYarn
yarn add @kashumaku/ethio-calendarUsage
Gregorian to Ethiopian
import { gregorianToEthiopian } from "@kashumaku/ethio-calendar"
const date = new Date(2026, 7, 12)
const ethiopianDate = gregorianToEthiopian(date)
console.log(ethiopianDate)Result:
{
year: 2018,
month: 12,
day: 5
}The returned object has the following structure:
interface EthiopianDate {
year: number
month: number
day: number
}Ethiopian to Gregorian
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
import { todayEthiopian } from "@kashumaku/ethio-calendar"
const today = todayEthiopian()
console.log(today)Example:
{
year: 2018,
month: 12,
day: 5
}Formatting
The formatEthiopian() function can convert a JavaScript Date or an EthiopianDate into a formatted Ethiopian date.
import { formatEthiopian } from "@kashumaku/ethio-calendar"
const date = new Date()
console.log(
formatEthiopian(date)
)Default format:
Sene 5, 2018Short Format
formatEthiopian(
new Date(),
"short",
)Example:
05/12/2018Medium Format
formatEthiopian(
new Date(),
"medium",
)Example:
Sene 5, 2018Long Format
formatEthiopian(
new Date(),
"long",
)Example:
Wednesday, Sene 5, 2018Amharic Formatting
Pass "am" as the locale.
import { formatEthiopian } from "@kashumaku/ethio-calendar"
const formatted = formatEthiopian(
new Date(),
"medium",
"am",
)
console.log(formatted)Example:
ሰኔ 5, 2018Long format:
formatEthiopian(
new Date(),
"long",
"am",
)Example:
ረቡዕ, ሰኔ 5, 2018Ethiopian Months
The Ethiopian calendar has 13 months.
| # | English | Amharic | | -: | -------- | ------- | | 1 | Meskerem | መስከረም | | 2 | Tikimt | ጥቅምት | | 3 | Hidar | ኅዳር | | 4 | Tahsas | ታኅሣሥ | | 5 | Tir | ጥር | | 6 | Yekatit | የካቲት | | 7 | Megabit | መጋቢት | | 8 | Miyazya | ሚያዝያ | | 9 | Ginbot | ግንቦት | | 10 | Sene | ሰኔ | | 11 | Hamle | ሐምሌ | | 12 | Nehase | ነሐሴ | | 13 | Pagume | ጳጉሜን |
The month constants are also exported:
import {
ETHIOPIAN_MONTHS_EN,
ETHIOPIAN_MONTHS_AM,
} from "@kashumaku/ethio-calendar"
console.log(ETHIOPIAN_MONTHS_EN)
console.log(ETHIOPIAN_MONTHS_AM)Ethiopian Leap Years
You can check whether an Ethiopian year is a leap year:
import { isEthiopianLeapYear } from "@kashumaku/ethio-calendar"
const result = isEthiopianLeapYear(2015)
console.log(result)Returns:
truePagume normally has 5 days and has 6 days in a leap year.
Date Validation
Validate an Ethiopian date before converting it:
import {
isValidEthiopianDate,
} from "@kashumaku/ethio-calendar"
const valid = isValidEthiopianDate(
2018,
13,
5,
)
console.log(valid)Returns:
trueAn invalid date:
const valid = isValidEthiopianDate(
2018,
13,
6,
)
console.log(valid)Returns:
falseReact Native / Expo
This package does not depend on Node.js or browser-specific APIs, so it can be used directly in React Native and Expo applications.
import { Text } from "react-native"
import { formatEthiopian } from "@kashumaku/ethio-calendar"
export function EthiopianDate() {
return (
<Text>
{formatEthiopian(
new Date(),
"long",
"am",
)}
</Text>
)
}TypeScript
The package includes TypeScript declarations.
You can import the EthiopianDate type:
import type {
EthiopianDate,
} from "@kashumaku/ethio-calendar"
const date: EthiopianDate = {
year: 2018,
month: 12,
day: 5,
}API
gregorianToEthiopian(date)
Converts a JavaScript Date to an Ethiopian date.
gregorianToEthiopian(
date: Date,
): EthiopianDateethiopianToGregorian(year, month, day)
Converts an Ethiopian date to a JavaScript Date.
ethiopianToGregorian(
year: number,
month: number,
day: number,
): DatetodayEthiopian()
Returns today's Ethiopian date.
todayEthiopian(): EthiopianDateformatEthiopian(date, format, locale)
Formats a Gregorian Date or Ethiopian date.
formatEthiopian(
date?: Date | EthiopianDate,
format?: "short" | "medium" | "long",
locale?: "en" | "am",
): stringisEthiopianLeapYear(year)
Checks whether an Ethiopian year is a leap year.
isEthiopianLeapYear(
year: number,
): booleanisValidEthiopianDate(year, month, day)
Checks whether an Ethiopian date is valid.
isValidEthiopianDate(
year: number,
month: number,
day: number,
): booleanZero Dependencies
This package has zero runtime dependencies.
It uses only native JavaScript/TypeScript functionality, making it suitable for:
- Web applications
- Node.js applications
- React applications
- React Native applications
- Expo applications
Contributing
Contributions are welcome.
If you find a bug, have a feature request, or want to improve the package, please open an issue or submit a pull request on the GitHub repository.
License
MIT License
Copyright (c) 2026
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
