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
ngx-angular-material-hijri-adapter
This library is an Angular material date adapter for Hijri Calendar Dates and Dates/Time depending on moment-hijri plugin and @angular/material.
@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)
npm install moment-hijri
90.8
Supply Chain
98.7
Quality
82.6
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
209 Stars
62 Commits
84 Forks
5 Watching
5 Branches
13 Contributors
Updated on 26 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.1%
2,611
Compared to previous day
Last week
8.5%
14,213
Compared to previous week
Last month
11.1%
55,174
Compared to previous month
Last year
55.2%
472,719
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 dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 6/24 approved changesets -- score normalized to 2
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 2024-11-18
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