npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

qenjs.js

v1.0.2

Published

A library to convert and format Ethiopian and Gregorian dates

Readme

QENJS: Ethiopian Date Handling Library

QENJS is a library for working with Ethiopian Dates, providing convenient methods for creating, formatting, manipulating, and converting Ethiopian dates. This README will guide you through various examples and functionalities available in the QENJS library. Check out the live demo of the qenjs: Qenjs Demo

Features

  • Convert between Ethiopian and Gregorian dates.
  • Format ethiopian dates in Amharic and latin.
  • Format gregorian dates
  • Calculate date difference and relative time

Installation

You can install qenjs via npm:

npm install qenjs

Alternatively, if you're using Yarn:

yarn add qenjs

Usage

Here's how you can start using MiniDayjs in your project:

1. Create Ethiopian Date

You can create an Ethiopian date using the following methods:

    const ethiopianDate = qenjs();
    console.log(ethiopianDate.toString()); // Outputs current ethiopian date

    const ethiopianDate2 = qenjs(2017, 1, 1);
    console.log(ethiopianDate2.toString()); // Outputs  01/01/2017

    const ethiopianDate3 = qenjs("2017-01-29");
    console.log(ethiopianDate3.format("DDDD, MMMM dd YYYY")); // Outputs: ረቡዕ, መስከረም 29 2017

    const ethiopianDate4= qenjs({ year: 2017, month: 4, day: 15 });
    console.log(ethiopianDate4.toString("DDDD, MMMM dd YYYY", "eng")); // Maksegno, Tahsas 15 2017

    const ethiopianDate4= qenjs.fromGregorianDate(new Date());
    console.log(ethiopianDate4.toString("DDDD, MMMM dd YYYY")); // Outputs current ethiopian date

    const ethiopianNightDate = qenjs("2017-01-29", { isNight: true });
    console.log(ethiopianNightDate.toString("dd/MM/YYYY HH:mm:ss A")); // 29/01/2017 01:00:00 ምሽት

2. Formatting Ethiopian Date

You can format Ethiopian dates using custom patterns. The default language is Amharic, but you can specify another language if needed.

        const ethiopianDate = qenjs({ year: 2017, month: 4, day: 15 });
        console.log(ethiopianDate.format("MMMM dd, YYYY", "amh")); // ታኅሣሥ 15, 2017

        console.log(ethiopianDate4.toString("DDDD, MMMM dd YYYY", "eng")); // Maksegno, Tahsas 15 2017

        console.log(qenjs.format(ethiopianDate3, "MMMM d, YYYY")); // ታኅሣሥ 15, 2017

3. Adding/Subtracting Days

You can manipulate Ethiopian dates by adding or subtracting days.

Example: Adding Days

    const ethiopianDate = qenjs(2017, 1, 1);
    const newDate = ethiopianDate.addDays(700);
    console.log(newDate.toString("DDDD, MMMM dd, YYYY")); // Add 700 days to the date

Example: Subtracting Days

    const ethiopianDate = qenjs(2017, 1, 1);
    const previousDate = ethiopianDate.subtractDays(5);
    console.log(previousDate.toString()); // Subtract 5 days from the date

4. Comparing Dates

QENJS provides methods to compare Ethiopian dates (e.g., checking if a date is before or after another date).

Example: Check if Date is Before

    const date1 = qenjs(2025, 1, 29);
    const date2 = qenjs(2024, 1, 29);
    console.log(date1.isBefore(date2)); // Should print false
    console.log(date1.isAfter(date2)); // Should print false
    console.log(date1.isSame(date2)); // Should print true

5. Converting to Gregorian Date

QENJS supports converting Ethiopian dates to Gregorian dates.

Example: Convert Ethiopian Date to Gregorian Date

    const ethiopianDate = qenjs({ year: 2017, month: 4, day: 15 });
    const gregorianDate = qenjs.toGregorianDate(ethiopianDate);
    console.log(gregorianDate.toISOString()); // Outputs the Gregorian equivalent

6. Relative Time

QENJS supports relative time, showing how much time has passed since or until a certain date.

Example: Get Relative Time

    Copy
    const ethiopianDate = qenjs(2017, 4, 15);
    console.log(ethiopianDate.fromNow()); // Outputs relative time like "X days ago" 

7. Date Differences

QENJS provides methods to calculate the difference between two Ethiopian dates.

Example: Date Difference

    const date1 = qenjs(2017, 1, 1);
    const date2 = qenjs(2017, 13, 5);
    console.log(qenjs.diff(date1, date2)); // Outputs the difference in days, months, or years
    console.log(qenjs.diff(date1, date2, "days")); // Difference in days

Contributing

We welcome contributions to qenjs! If you'd like to help improve the Ethiopian Date Converter or suggest new features, feel free to fork the repository and submit a pull request.

How to Contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Make your changes and commit them.
  4. Push to your fork and create a pull request.

Please make sure to follow the coding style and include tests for new features or bug fixes.

Thank You

Thank you for exploring this repository! Your interest and support mean a lot. I hope this project provides value to you. If you find it useful, feel free to explore the code, report issues, or contribute!

Happy coding! 🚀