🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

kenat

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kenat

A JavaScript library for the Ethiopian calendar with date and time support.

latest
Source
npmnpm
Version
3.2.0
Version published
Weekly downloads
397
5.31%
Maintainers
1
Weekly downloads
 
Created
Source

Kenat / ቀናት NPM Version

banner

Build Status npm bundle size GitHub issues GitHub Repo stars GitHub forks GitHub commit activity npm downloads

Kenat / ቀናት

📌 Overview
Kenat (Amharic: ቀናት) is a comprehensive JavaScript library for the Ethiopian calendar. It provides a complete toolset for developers, handling date conversions, advanced formatting, full date arithmetic, and a powerful, authentic holiday calculation system based on the traditional Bahire Hasab (ባሕረ ሃሳብ).

✨ Features

  • 🔄 Bidirectional Conversion: Seamlessly convert between Ethiopian and Gregorian calendars.
  • 🗂️ Complete Holiday System: Pre-loaded with all public, religious (Christian & Muslim), and cultural holidays.
  • 🔎 Advanced Holiday Filtering: Easily filter holidays by tags (e.g., public, christian, muslim).
  • 📖 Authentic Liturgical Calculations: Implements Bahire Hasab for movable feasts and fasts.
  • 🔠 Localized Formatting: Display dates in both Amharic and English.
  • 🔢 Geez Numerals: Convert numbers and dates to traditional Geez numeral equivalents.
  • Full Date Arithmetic: Add or subtract days, months, and years with support for the 13-month calendar.
  • ↔️ Date Difference: Calculate precise differences between two dates.
  • 🕒 Ethiopian Time: Convert between 24-hour Gregorian and 12-hour Ethiopian time.
  • 🗓️ Calendar Generation: Create monthly or yearly calendar grids.

🚀 Installation

npm install kenat

🔰 Quick Start

Get today’s Ethiopian date:

import Kenat from 'kenat';

const today = new Kenat();

console.log(today.getEthiopian());
// → { year: 2017, month: 9, day: 26 }

console.log(today.format({ lang: 'english', showWeekday: true }));
// → "Friday, Ginbot 26 2017"

⛪ Bahire Hasab & Holiday System

Get All Holidays for a Year

import { getHolidaysForYear } from 'kenat';

const holidaysIn2017 = getHolidaysForYear(2017);

console.log(holidaysIn2017.find(h => h.key === 'fasika'));
// Output for Fasika (Easter) in 2017
{
  key: 'fasika',
  tags: ['public', 'religious', 'christian'],
  movable: true,
  name: 'ፋሲካ',
  description: 'የኢየሱስ ክርስቶስን ከሙታን መነሣት ያከብራል።...',
  ethiopian: { year: 2017, month: 8, day: 21 },
  gregorian: { year: 2025, month: 4, day: 29 }
}

Filter Holidays by Tag

import { getHolidaysForYear, HolidayTags } from 'kenat';

const publicHolidays = getHolidaysForYear(2017, {
  filter: HolidayTags.PUBLIC
});

const religiousHolidays = getHolidaysForYear(2017, {
  filter: [HolidayTags.CHRISTIAN, HolidayTags.MUSLIM]
});

Check if a Specific Date is a Holiday

const meskel = new Kenat('2017/1/17');
console.log(meskel.isHoliday()); // → Returns the Meskel holiday object

const notHoliday = new Kenat('2017/1/18');
console.log(notHoliday.isHoliday()); // → []

Access Bahire Hasab Calculations

const bahireHasab = new Kenat('2017/1/1').getBahireHasab();

console.log(bahireHasab.evangelist);
// → { name: 'ማቴዎስ', remainder: 1 }

console.log(bahireHasab.movableFeasts.fasika.ethiopian);
// → { year: 2017, month: 8, day: 21 }
// Full output of .getBahireHasab() for 2017
{
  ameteAlem: 7517,
  meteneRabiet: 1879,
  evangelist: { name: 'ማቴዎስ', remainder: 1 },
  newYear: { dayName: 'ረቡዕ', tinteQemer: 2 },
  medeb: 12,
  wenber: 11,
  abektie: 1,
  metqi: 29,
  bealeMetqi: { date: { year: 2017, month: 1, day: 29 }, weekday: 'Wednesday' },
  mebajaHamer: 3,
  nineveh: { year: 2017, month: 6, day: 3 },
  movableFeasts: {
    nineveh: { /* ... */ },
    abiyTsome: { /* ... */ },
    fasika: {
      key: 'fasika',
      tags: ['public', 'religious', 'christian'],
      movable: true,
      name: 'ፋሲካ',
      description: 'የኢየሱስ ክርስቶስን ከሙታን መነሣት ያከብራል።...',
      ethiopian: { year: 2017, month: 8, day: 21 },
      gregorian: { year: 2025, month: 4, day: 29 }
    },
    // ... other movable holidays
  }
}

➕ More API Examples

Date Arithmetic

const today = new Kenat();
const nextWeek = today.addDays(7);
const lastMonth = today.addMonths(-1);

Date Difference

const a = new Kenat('2015/5/15');
const b = new Kenat('2012/5/15');

console.log(a.diffInDays(b));    // → 1095
console.log(a.diffInYears(b));   // → 3

Geez Numerals

import { toGeez } from 'kenat';

console.log(toGeez(2017)); // → "፳፻፲፯"

📊 API Reference

Refer to the full documentation site for method details, utility functions, and live examples.

🎉 Coming Soon

  • ✅ Ethiopian Seasons (Tseday, Bega, Kiremt, Meher)
  • ✅ Helpers like .isSameMonth() and .startOfYear()
  • 🚀 Multi-language ports (Python, PHP, Dart)
  • ⚙️ .ics iCalendar export

🧱 Contribution Guide

  • Fork the repo & clone it.

  • Create a new branch:

    git checkout -b feature/your-feature
    
  • Write your changes and add tests in the /tests directory.

  • Run npm test to ensure everything passes.

  • Open a Pull Request with your improvements or bug fix.

👨‍💻 Author

Melaku Demeke GitHubLinkedIn

📄 License

MIT — see LICENSE for details.

Keywords

ethiopian

FAQs

Package last updated on 18 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts