Gathering detailed insights and metrics for react-moment-proptypes
Gathering detailed insights and metrics for react-moment-proptypes
Gathering detailed insights and metrics for react-moment-proptypes
Gathering detailed insights and metrics for react-moment-proptypes
npm install react-moment-proptypes
Typescript
Module System
Node Version
NPM Version
98.7
Supply Chain
87.9
Quality
78.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
49 Stars
115 Commits
17 Forks
3 Watchers
3 Branches
6 Contributors
Updated on Aug 24, 2022
Latest Version
1.8.1
Package Id
react-moment-proptypes@1.8.1
Size
8.66 kB
NPM Version
7.7.0
Node Version
14.15.0
Published on
Mar 24, 2021
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
A React Proptype Validator to check if passed prop is a moment.js construct
1var momentPropTypes = require('react-moment-proptypes'); 2 3var TestClass = React.createClass({ 4 propTypes : { 5 dateThing : momentPropTypes.momentObj, 6 dateThingWithPredicate : momentPropTypes.momentObj.withPredicate( 7 function isUTC(momentObject) { 8 return momentObject.isUTC(); 9 } 10 ), 11 stringThing : momentPropTypes.momentString, 12 durationThing: momentPropTypes.momentDurationObj, 13 }, 14 15 render : function() { 16 return null 17 }, 18}); 19 20// Class Use 21<TestClass dateThing={moment()} 22 dateThingWithPredicate={moment.utc()} 23 stringThing={'12-12-2014'} 24 durationThing={moment.duration(3, 'hours')}/> 25
Moment provides a moment.createFromInputFallback
method you can define to create additional parsing rules.
With some versions of moment you may receive the following console warning:
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: not a date, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at [... stack trace]
Example implementations can be found at the given documentation link.
Tests were approached with enzyme
and React's test utility renderer
npm test
for running unit and integration testsnpm run coverage
for current test coveragenpm run test-all
to test against tested moment version (1.6.0, 1.7.0, current)If there is a desire for varying moment legacy support I'm willing to add it, but will stick to YAGNI until then.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/13 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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