Gathering detailed insights and metrics for moment-hijri
Gathering detailed insights and metrics for moment-hijri
Gathering detailed insights and metrics for moment-hijri
Gathering detailed insights and metrics for moment-hijri
@types/moment-hijri
TypeScript definitions for moment-hijri
@date-io/hijri
Abstraction over common javascript date management libraries
moment-hijri-fixed
A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js. (fixed bug related to moment hijri)
@ashgkwd/moment-hijri
A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js.
A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js
npm install moment-hijri
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
221 Stars
62 Commits
84 Forks
4 Watchers
5 Branches
12 Contributors
Updated on May 18, 2025
Latest Version
3.0.0
Package Id
moment-hijri@3.0.0
Unpacked Size
59.80 kB
Size
14.07 kB
File Count
13
NPM Version
10.2.4
Node Version
20.11.0
Published on
Oct 31, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A Hijri (Based on Umm al-Qura calculations) calendar system plugin for moment.js.
Hijri is the Islamic lunar calendar used by Muslims to determine the proper days on which to observe the annual fasting, to attend Hajj, and to celebrate other Islamic holidays and festivals. More information about Hijri can be found at wikipedia.
This plugin adds Hijri calendar support to momentjs library.
Calendar conversion is based on the Umm al-Qura calculations.
Adjusted dates has been changed to match ummalqura:-
Because of Using 'h' specifier might cause overlap with hour's specifier, the specifier has been changed from h
to i
as a prefix. For example in the previous version to get the four digit year,
hYYYY
will be used. In version 2.0 or above it should be replaced by iYYYY
.
Like momentjs
, moment-hijri
works in browser and in Node.js.
1npm install moment-hijri
1var moment = require('moment-hijri'); 2moment().format('iYYYY/iM/iD');
1<script src="moment.js"></script> 2<script src="moment-hijri.js"></script> 3<script> 4 moment().format('iYYYY/iM/iD'); 5</script>
1require.config({ 2 paths: { 3 "moment": "path/to/moment", 4 "moment-hijri": "path/to/moment-hijri" 5 } 6}); 7define(["moment-hijri"], function (moment) { 8 moment().format('iYYYY/iM/iD'); 9});
This plugin tries to mimic momentjs
api. Basically, when formatting or parsing a string, add an i
to the format token such as 'iYYYY' or 'iM'. For example:
1m = moment('1410/8/28', 'iYYYY/iM/iD'); // Parse a Hijri date. 2m.format('iYYYY/iM/iD [is] YYYY/M/D'); // 1410/8/28 is 1990/3/25 3 4m.iYear(); // 1410 5m.iMonth(); // 7 6m.iDate(); // 28 7m.iDayOfYear(); // 236 8m.iWeek(); // 35 9m.iWeekYear(); // 1410 10 11m.add(1, 'iYear'); 12m.add(2, 'iMonth'); 13m.add(1, 'idate'); 14m.format('iYYYY/iM/iD'); // 1411/10/29 15 16m.iMonth(11); 17m.startOf('iMonth'); 18m.format('iYYYY/iM/iD'); // 1411/12/1 19 20m.iYear(1392); 21m.startOf('iYear'); 22m.format('iYYYY/iM/iD'); // 1420/1/1 23 24moment('1436/1/30', 'iYYYY/iMM/iDD').isValid(); // false (This month is only 29 days). 25moment('1436/2/30', 'iYYYY/iMM/iDD').isValid(); // true (This month is 30 days). 26 27moment('1436/2/6 16:40', 'iYYYY/iM/iD HH:mm').format('YYYY-M-D HH:mm:ss'); // 2014-11-28 16:40:00 28 29moment('2014-11-28 16:40:00', 'YYYY-M-D HH:mm:ss').endOf('iMonth').format('iYYYY/iM/iD HH:mm:ss'); // 1436/2/30 23:59:59 30 31// Complex parse: 32moment('1990 5 25', 'YYYY iM D').format('YYYY/MM/DD'); // 1990/03/25
To use the Arabic locale:
ar-SA
see here.Here is example:
1 <!-- 1- Load the moment-with-locales --> 2 <script src="http://momentjs.com/downloads/moment-with-locales.min.js"></script> 3 <script src="https://raw.githubusercontent.com/xsoh/moment-hijri/master/moment-hijri.js"></script> 4 5 <script> 6 moment.locale('ar-SA');// 2- Set the global locale to `ar-SA` 7 m = moment(); 8 m.format('iYYYY/iM/iDهـ الموافق YYYY/M/Dم'); //3- use it normally 9 //١٤٣٧/٨/١٧هـ الموافق ٢٠١٦/٥/٢٤م 10 </script>
This project was built from the great work done by @behrang whose behind moment-jalaali project.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 6/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More