Installations
npm install chartjs-adapter-moment
Releases
Contributors
Developer
chartjs
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
12.22.12
NPM Version
6.14.16
Statistics
37 Stars
83 Commits
23 Forks
5 Watching
6 Branches
9 Contributors
Updated on 25 Sept 2024
Bundle Size
1.04 kB
Minified
531.00 B
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
13,701,355
Last day
1.2%
26,957
Compared to previous day
Last week
1.3%
131,386
Compared to previous week
Last month
16.3%
552,534
Compared to previous month
Last year
34.6%
6,080,233
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
20
chartjs-adapter-moment
Overview
This adapter allows the use of Moment.js with Chart.js. Moment.js is a very heavy library and thus not recommended for client-side development. However, it was previously the only library supported by Chart.js and so continues to be supported. You may prefer chartjs-adapter-date-fns for a minimal bundle size or chartjs-adapter-luxon for larger bundle size with additional functionality included such as i18n and time zone support.
Requires Chart.js 3.0.0 or later and Moment.js 2.0.0 or later. To use Chart.js v2.x, utilize v0.1.2 of the adapter.
Note: once loaded, this adapter overrides the default date-adapter provided in Chart.js (as a side-effect).
Installation
npm
npm install moment chartjs-adapter-moment --save
1import { Chart } from 'chart.js'; 2import 'chartjs-adapter-moment';
CDN
By default, https://cdn.jsdelivr.net/npm/chartjs-adapter-moment
returns the latest (minified) version, however it's highly recommended to always specify a version in order to avoid breaking changes. This can be achieved by appending @{version}
to the URL:
1<script src="https://cdn.jsdelivr.net/npm/chart.js@^3"></script> 2<script src="https://cdn.jsdelivr.net/npm/moment@^2"></script> 3<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-moment@^1"></script>
Read more about jsDelivr versioning on their website.
Configuration
Read the Chart.js documention for possible date/time related options. For example, the time scale time.*
options can be overridden using the Moment formats.
Development
You first need to install node dependencies (requires Node.js):
> npm install
The following commands will then be available from the repository root:
> gulp build // build dist files
> gulp build --watch // build and watch for changes
> gulp lint // perform code linting
License
chartjs-adapter-moment
is available under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compressed-size.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/compressed-size.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/compressed-size.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/compressed-size.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/npmpublish.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-drafter.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-moment/release-drafter.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/npmpublish.yml:41
- Info: 0 out of 7 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 5 third-party GitHubAction dependencies pinned
- Info: 3 out of 4 npmCommand dependencies pinned
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
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/compressed-size.yml:1
- Warn: no topLevel permission defined: .github/workflows/npmpublish.yml:1
- Warn: no topLevel permission defined: .github/workflows/release-drafter.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
Project has not signed or included provenance with any releases.
Details
- Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/chartjs/chartjs-adapter-moment/releases/28555021
- Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/chartjs/chartjs-adapter-moment/releases/28555021
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 30 are checked with a SAST tool
Reason
11 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
3.3
/10
Last Scanned on 2024-11-25
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