Installations
npm install chartjs-adapter-date-fns
Releases
Developer
chartjs
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
No
Node Version
16.18.1
NPM Version
8.19.2
Statistics
108 Stars
57 Commits
34 Forks
5 Watching
4 Branches
12 Contributors
Updated on 23 Nov 2024
Bundle Size
2.68 kB
Minified
780.00 B
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
23,265,183
Last day
-2.4%
53,022
Compared to previous day
Last week
1.3%
275,149
Compared to previous week
Last month
6.4%
1,154,553
Compared to previous month
Last year
61.5%
11,637,914
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
19
chartjs-adapter-date-fns
Overview
This adapter allows the use of date-fns with Chart.js.
Requires Chart.js 2.8.0 or later and date-fns 2.0.0 or later.
Note: once loaded, this adapter overrides the default date-adapter provided in Chart.js (as a side-effect).
Installation
npm
1npm install date-fns chartjs-adapter-date-fns --save
1import { Chart } from 'chart.js'; 2import 'chartjs-adapter-date-fns';
CDN
By default, https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns
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/dist/chart.min.js"></script> 2<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
Read more about jsDeliver versioning on their website.
Configuration
Locale support via scale options
date-fns requires a date-fns locale object to be tagged on to each format()
call, which requires the locale to be explicitly set via the adapters.date
option: Chart.js documentation on adapters.date
For example:
1// import date-fns locale: 2import {de} from 'date-fns/locale'; 3 4 5// scale options: 6{ 7 adapters: { 8 date: { 9 locale: de 10 } 11 } 12}
Further, read the Chart.js documentation for other possible date/time related options. For example, the time scale time.*
options can be overridden using the date-fns tokens.
Development
You first need to install node dependencies (requires Node.js):
1> npm install
The following commands will then be available from the repository root:
1> npm run build // build dist files 2> npm run lint // perform code linting
License
chartjs-adapter-date-fns
is available under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
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
Found 7/13 approved changesets -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- 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-date-fns/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/compressed-size.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/compressed-size.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/compressed-size.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/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-date-fns/npmpublish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/chartjs/chartjs-adapter-date-fns/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-date-fns/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-date-fns/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-date-fns/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
no effort to earn an OpenSSF best practices badge detected
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
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 v1.1.0-alpha.3 not signed: https://api.github.com/repos/chartjs/chartjs-adapter-date-fns/releases/28768803
- Warn: release artifact v1.1.0-alpha.3 does not have provenance: https://api.github.com/repos/chartjs/chartjs-adapter-date-fns/releases/28768803
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 26 are checked with a SAST tool
Reason
13 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-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- 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-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
3.2
/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 MoreOther packages similar to chartjs-adapter-date-fns
chartjs-adapter-moment
Chart.js adapter to use Moment.js for time functionalities
@date-io/date-fns
Abstraction over common javascript date management libraries
date-fns
Modern JavaScript date utility library
@date-io/date-fns-jalali
Abstraction over common javascript date management libraries