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

moment-hijri-plus

v1.0.4

Published

Moment.js plugin for Hijri calendar conversion and formatting. Supports Umm al-Qura and FCNA calendars via hijri-core.

Readme

moment-hijri-plus

npm version CI License: MIT

Moment.js plugin for Hijri calendar conversion and formatting. Delegates all calendar logic to hijri-core, a zero-dependency Hijri engine with pluggable calendar support (Umm al-Qura and FCNA/ISNA).

Installation

pnpm add moment moment-hijri-plus hijri-core

Both moment and hijri-core are peer dependencies.

Quick Start

import moment from 'moment';
import installHijri from 'moment-hijri-plus';

installHijri(moment);

const m = moment(new Date(2023, 2, 23)); // 23 March 2023
m.toHijri();            // { hy: 1444, hm: 9, hd: 1 }  (1 Ramadan 1444 AH)
m.formatHijri('iD iMMMM iYYYY AH'); // '1 Ramadan 1444 AH'

moment.fromHijri(1446, 1, 1); // moment for 7 July 2024

API Summary

Call installHijri(moment) once at startup to add these methods.

| Method | Returns | Description | | --- | --- | --- | | toHijri(options?) | HijriDate \| null | Convert to Hijri date object | | hijriYear(options?) | number \| null | Hijri year | | hijriMonth(options?) | number \| null | Hijri month (1-12) | | hijriDay(options?) | number \| null | Hijri day | | isValidHijri(options?) | boolean | True if date is within calendar range | | formatHijri(fmt, options?) | string | Format with Hijri tokens; non-Hijri tokens pass through | | moment.fromHijri(hy, hm, hd, options?) | Moment | Construct moment from Hijri date |

Pass { calendar: 'fcna' } to switch from the default Umm al-Qura calendar to FCNA/ISNA.

Full API reference, format token table, and examples are in the project wiki.

Day boundaries and time zones

Conversions use the calendar date the moment instance displays, not the underlying UTC instant. A moment("2025-03-01") parsed in any local timezone returns the Hijri date for March 1st, 2025. A moment created with .utc() uses its UTC components.

Religious day-start at sunset is outside the scope of this package; it depends on location and madhab, and must be handled at the application layer.

Note on Moment.js

Moment.js is in maintenance mode. For new projects, dayjs-hijri-plus offers the same Hijri support on Day.js. This package targets existing codebases already using Moment.js.

Related

License

MIT. Copyright (c) 2026 Aric Camarata.