This adapter allows the use of Moment.js with Chart.js

Overview

chartjs-adapter-moment

release travis awesome

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
import { Chart } from 'chart.js';
import '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:

">
<script src="https://cdn.jsdelivr.net/npm/chart.js@^3">script>
<script src="https://cdn.jsdelivr.net/npm/moment@^2">script>
<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.

Comments
  • Week time unit format

    Week time unit format

    Having a look to the formats related to the time unit, I see that for week the format is:

    week: 'll'

    but reading the moment documentation, the format for week should

    week: 'w' or week: 'w YYYY

    Is there any reason why?

    opened by stockiNail 8
  • TypeError: Cannot read property '_date' of undefined when using Chartjs 3.x.x

    TypeError: Cannot read property '_date' of undefined when using Chartjs 3.x.x

    The import on the index.js seems to fail when using in a typescript project.

    image image

    After locally changing from import {Chart} from 'chart.js'; to import * as Chart from 'chart.js'; the extension works again.

    https://github.com/chartjs/Chart.js/blob/7ec99c38c1b41b16cf7cad433569af56c2544d63/types/index.esm.d.ts#L25

    I checked the charts repo and the adapters are separate. There's no default export of ChartJs so the fix is:

    • update ChartJs ts exports so Chart is the default export
    • on this adapter change the import to import * as Chart from 'chart.js'; or
    • on this adapter change the import to `import {_adapter} from 'chart.js';
    bug 
    opened by esttenorio 4
  • Bump hosted-git-info from 2.8.8 to 2.8.9

    Bump hosted-git-info from 2.8.8 to 2.8.9

    Bumps hosted-git-info from 2.8.8 to 2.8.9.

    Changelog

    Sourced from hosted-git-info's changelog.

    2.8.9 (2021-04-07)

    Bug Fixes

    Commits
    Maintainer changes

    This version was pushed to npm by nlf, a new releaser for hosted-git-info since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Enhancement: what do you think to add I18N support?

    Enhancement: what do you think to add I18N support?

    Currently the adapater is not managing the I18N.

    Nevertheless Moment.js is supporting I18N and due to CHART.JS 3 introuced the locale options, maybe it could make sense to add this kind of support also for Moment adapter.

    In my opinion to use I18N in moment, the user should:

    1. should have a look how to prepare the I18N into Moment.js (see doc https://momentjs.com/docs/#/i18n/) in order to be aware how to leverage on this feature, depending on the runtime; environment;
    2. pass an options (like the other adapters) where is setting the locale as following:
    // time scale config
    scales: {
        x: {
            type: 'time',
            adapters: {
                date: {
                    locale: 'en-US'
                },
            },
            time: {
                unit: 'day'
            }
        },
    }
    

    What do you think? If you think it could be helpful, I can try to submit a PR.

    opened by stockiNail 2
  • Bump ua-parser-js and chartjs-test-utils

    Bump ua-parser-js and chartjs-test-utils

    Removes ua-parser-js. It's no longer used after updating ancestor dependency chartjs-test-utils. These dependencies need to be updated together.

    Removes ua-parser-js

    Updates chartjs-test-utils from 0.1.3 to 0.5.0

    Release notes

    Sourced from chartjs-test-utils's releases.

    v0.5.0

    • #27 Bump ansi-regex from 3.0.0 to 3.0.1
    • #26 Bump minimist from 1.2.5 to 1.2.6
    • #25 Bump karma from 6.3.4 to 6.3.17
    • #24 Bump follow-redirects from 1.14.3 to 1.14.8

    Enhancements

    • #28 Allow newer versions of `peerDependencies`

    Development

    • #29 Bump version to 0.5.0, update deps

    Thanks to @​benmccann, @​dependabot, @​dependabot[bot] and @​kurkle

    v0.4.0

    • #19 triggerMouseEvent now returns the triggered event

    Enhancements

    • #18 convert karma+jasmine to peer deps

    Documentation

    • #15 Update JSDoc

    Thanks to @​etimberg, @​joshkel and @​snoozbuster

    Version 0.3.1

    Bugs Fixed

    • #14 Add support for masked native event types

    Thanks to @​kurkle

    Version 0.3.0

    Breaking Changes

    • #11 Update toEqualImageData to verify size

    Enhancements

    • #11 Update toEqualImageData to verify size

    Development

    • #12 Bump version to 0.3.0, update dependencies

    Version 0.2.2

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump xmlhttprequest-ssl and engine.io-client

    Bump xmlhttprequest-ssl and engine.io-client

    Bumps xmlhttprequest-ssl and engine.io-client. These dependencies needed to be updated together. Updates xmlhttprequest-ssl from 1.5.5 to 1.6.3

    Commits
    • 711bd4a Prepare release 1.6.3
    • 4e8322f Merge pull request #8 from mrcarlberg/mjwwit_unescape_url_pathname_when_loadi...
    • ee1e81f Fix CVE-2020-28502
    • 6a0a91d Unescape pathname from url when loading from local filesystem
    • bf53329 Fix issue where rejectUnauthorized would default to false instead of true
    • ae38832 1.6.0
    • 534b586 Remove superfluous + operator
    • a9d93fb Replace deprecated sys.puts calls with console.log in tests
    • efc39e9 Merge pull request #6 from wesgarland/master
    • b9fedb0 pushed version to 1.5.6
    • Additional commits viewable in compare view

    Updates engine.io-client from 3.5.1 to 3.5.3

    Release notes

    Sourced from engine.io-client's releases.

    3.5.3

    Bug Fixes

    Links

    3.5.2

    This release only contains a bump of xmlhttprequest-ssl, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.

    Please note that engine.io-client was not directly impacted by this vulnerability, since we are always using async: true.

    Links

    Changelog

    Sourced from engine.io-client's changelog.

    3.5.3 (2022-09-07)

    Bug Fixes

    3.5.2 (2021-05-05)

    This release only contains a bump of xmlhttprequest-ssl, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.

    Please note that engine.io-client was not directly impacted by this vulnerability, since we are always using async: true.

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump engine.io and socket.io

    Bump engine.io and socket.io

    Bumps engine.io and socket.io. These dependencies needed to be updated together. Updates engine.io from 3.5.0 to 3.6.0

    Release notes

    Sourced from engine.io's releases.

    3.6.0

    Bug Fixes

    • add extension in the package.json main entry (#608) (3ad0567)
    • do not reset the ping timer after upgrade (1f5d469)

    Features

    • decrease the default value of maxHttpBufferSize (58e274c)

    This change reduces the default value from 100 mb to a more sane 1 mb.

    This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data.

    See also: https://github.com/advisories/GHSA-j4f2-536g-r55m

    • increase the default value of pingTimeout (f55a79a)

    Links

    Changelog

    Sourced from engine.io's changelog.

    3.6.0 (2022-06-06)

    Bug Fixes

    Features

    • decrease the default value of maxHttpBufferSize (58e274c)

    This change reduces the default value from 100 mb to a more sane 1 mb.

    This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data.

    See also: https://github.com/advisories/GHSA-j4f2-536g-r55m

    • increase the default value of pingTimeout (f55a79a)

    6.2.0 (2022-04-17)

    Features

    • add the "maxPayload" field in the handshake details (088dcb4)

    So that clients in HTTP long-polling can decide how many packets they have to send to stay under the maxHttpBufferSize value.

    This is a backward compatible change which should not mandate a new major revision of the protocol (we stay in v4), as we only add a field in the JSON-encoded handshake data:

    0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000,"maxPayload":1000000}
    

    6.1.3 (2022-02-23)

    Bug Fixes

    • typings: allow CorsOptionsDelegate as cors options (#641) (a463d26)
    • uws: properly handle chunked content (#642) (3367440)

    ... (truncated)

    Commits
    • f62f265 chore(release): 3.6.0
    • f55a79a feat: increase the default value of pingTimeout
    • 1f5d469 fix: do not reset the ping timer after upgrade
    • 3ad0567 fix: add extension in the package.json main entry (#608)
    • 58e274c feat: decrease the default value of maxHttpBufferSize
    • See full diff in compare view

    Updates socket.io from 2.4.1 to 2.5.0

    Release notes

    Sourced from socket.io's releases.

    2.5.0

    :warning: WARNING :warning:

    The default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service.

    Security advisory: https://github.com/advisories/GHSA-j4f2-536g-r55m

    Bug Fixes

    • fix race condition in dynamic namespaces (05e1278)
    • ignore packet received after disconnection (22d4bdf)
    • only set 'connected' to true after middleware execution (226cc16)
    • prevent the socket from joining a room after disconnection (f223178)

    Links:

    Changelog

    Sourced from socket.io's changelog.

    2.5.0 (2022-06-26)

    Bug Fixes

    • fix race condition in dynamic namespaces (05e1278)
    • ignore packet received after disconnection (22d4bdf)
    • only set 'connected' to true after middleware execution (226cc16)
    • prevent the socket from joining a room after disconnection (f223178)

    4.5.1 (2022-05-17)

    Bug Fixes

    • forward the local flag to the adapter when using fetchSockets() (30430f0)
    • typings: add HTTPS server to accepted types (#4351) (9b43c91)

    4.5.0 (2022-04-23)

    Bug Fixes

    • typings: ensure compatibility with TypeScript 3.x (#4259) (02c87a8)

    Features

    • add support for catch-all listeners for outgoing packets (531104d)

    This is similar to onAny(), but for outgoing packets.

    Syntax:

    socket.onAnyOutgoing((event, ...args) => {
      console.log(event);
    });
    
    • broadcast and expect multiple acks (8b20457)

    Syntax:

    io.timeout(1000).emit("some-event", (err, responses) => {
    </tr></table> 
    

    ... (truncated)

    Commits
    • baa6804 chore(release): 2.5.0
    • f223178 fix: prevent the socket from joining a room after disconnection
    • 226cc16 fix: only set 'connected' to true after middleware execution
    • 05e1278 fix: fix race condition in dynamic namespaces
    • 22d4bdf fix: ignore packet received after disconnection
    • dfded53 chore: update engine.io version to 3.6.0
    • See full diff in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • jsdelivr CDN is missing chartjs-adapter-moment@0.1.0

    jsdelivr CDN is missing [email protected]

    Hi, thanks for all the hard works and I'm exited for the 3.0.0 and forward.

    In current document, https://cdn.jsdelivr.net/npm/[email protected] is listed but it seems that doesn't exist in jsdelivr, however v0.1.1 does exist.

    will this be a common practice to remove older version until project becomes more stable? or is this just a mishap?

    opened by jung-kim 1
  • Bump qs and body-parser

    Bump qs and body-parser

    Bumps qs and body-parser. These dependencies needed to be updated together. Updates qs from 6.7.0 to 6.11.0

    Changelog

    Sourced from qs's changelog.

    6.11.0

    • [New] [Fix] stringify: revert 0e903c0; add commaRoundTrip option (#442)
    • [readme] fix version badge

    6.10.5

    • [Fix] stringify: with arrayFormat: comma, properly include an explicit [] on a single-item array (#434)

    6.10.4

    • [Fix] stringify: with arrayFormat: comma, include an explicit [] on a single-item array (#441)
    • [meta] use npmignore to autogenerate an npmignore file
    • [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-symbol, object-inspect, tape

    6.10.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [actions] reuse common workflows
    • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, tape

    6.10.2

    • [Fix] stringify: actually fix cyclic references (#426)
    • [Fix] stringify: avoid encoding arrayformat comma when encodeValuesOnly = true (#424)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] add note and links for coercing primitive values (#408)
    • [actions] update codecov uploader
    • [actions] update workflows
    • [Tests] clean up stringify tests slightly
    • [Dev Deps] update eslint, @ljharb/eslint-config, aud, object-inspect, safe-publish-latest, tape

    6.10.1

    • [Fix] stringify: avoid exception on repeated object values (#402)

    6.10.0

    • [New] stringify: throw on cycles, instead of an infinite loop (#395, #394, #393)
    • [New] parse: add allowSparse option for collapsing arrays with missing indices (#312)
    • [meta] fix README.md (#399)
    • [meta] only run npm run dist in publish, not install
    • [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-symbols, tape
    • [Tests] fix tests on node v0.6
    • [Tests] use ljharb/actions/node/install instead of ljharb/actions/node/run
    • [Tests] Revert "[meta] ignore eclint transitive audit warning"

    6.9.7

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] stringify: avoid encoding arrayformat comma when encodeValuesOnly = true (#424)
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] add note and links for coercing primitive values (#408)
    • [Tests] clean up stringify tests slightly
    • [meta] fix README.md (#399)
    • Revert "[meta] ignore eclint transitive audit warning"

    ... (truncated)

    Commits
    • 56763c1 v6.11.0
    • ddd3e29 [readme] fix version badge
    • c313472 [New] [Fix] stringify: revert 0e903c0; add commaRoundTrip option
    • 95bc018 v6.10.5
    • 0e903c0 [Fix] stringify: with arrayFormat: comma, properly include an explicit `[...
    • ba9703c v6.10.4
    • 4e44019 [Fix] stringify: with arrayFormat: comma, include an explicit [] on a s...
    • 113b990 [Dev Deps] update object-inspect
    • c77f38f [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-symbol, tape
    • 2cf45b2 [meta] use npmignore to autogenerate an npmignore file
    • Additional commits viewable in compare view

    Updates body-parser from 1.19.0 to 1.20.1

    Release notes

    Sourced from body-parser's releases.

    1.20.0

    1.19.2

    1.19.1

    Changelog

    Sourced from body-parser's changelog.

    1.20.1 / 2022-10-06

    1.20.0 / 2022-04-02

    1.19.2 / 2022-02-15

    1.19.1 / 2021-12-10

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump engine.io and socket.io

    Bump engine.io and socket.io

    Bumps engine.io and socket.io. These dependencies needed to be updated together. Updates engine.io from 6.1.3 to 6.2.1

    Release notes

    Sourced from engine.io's releases.

    6.2.1

    :warning: This release contains an important security fix :warning:

    A malicious client could send a specially crafted HTTP request, triggering an uncaught exception and killing the Node.js process:

    Error: read ECONNRESET
        at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
    Emitted 'error' event on Socket instance at:
        at emitErrorNT (internal/streams/destroy.js:106:8)
        at emitErrorCloseNT (internal/streams/destroy.js:74:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      errno: -104,
      code: 'ECONNRESET',
      syscall: 'read'
    }
    

    Please upgrade as soon as possible.

    Bug Fixes

    • catch errors when destroying invalid upgrades (#658) (425e833)

    6.2.0

    Features

    • add the "maxPayload" field in the handshake details (088dcb4)

    So that clients in HTTP long-polling can decide how many packets they have to send to stay under the maxHttpBufferSize value.

    This is a backward compatible change which should not mandate a new major revision of the protocol (we stay in v4), as we only add a field in the JSON-encoded handshake data:

    0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000,"maxPayload":1000000}
    

    Links

    Changelog

    Sourced from engine.io's changelog.

    6.2.1 (2022-11-20)

    :warning: This release contains an important security fix :warning:

    A malicious client could send a specially crafted HTTP request, triggering an uncaught exception and killing the Node.js process:

    Error: read ECONNRESET
        at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
    Emitted 'error' event on Socket instance at:
        at emitErrorNT (internal/streams/destroy.js:106:8)
        at emitErrorCloseNT (internal/streams/destroy.js:74:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      errno: -104,
      code: 'ECONNRESET',
      syscall: 'read'
    }
    

    Please upgrade as soon as possible.

    Bug Fixes

    • catch errors when destroying invalid upgrades (#658) (425e833)

    3.6.0 (2022-06-06)

    Bug Fixes

    Features

    • decrease the default value of maxHttpBufferSize (58e274c)

    This change reduces the default value from 100 mb to a more sane 1 mb.

    This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data.

    See also: https://github.com/advisories/GHSA-j4f2-536g-r55m

    • increase the default value of pingTimeout (f55a79a)

    ... (truncated)

    Commits
    • 24b847b chore(release): 6.2.1
    • 425e833 fix: catch errors when destroying invalid upgrades (#658)
    • 99adb00 chore(deps): bump xmlhttprequest-ssl and engine.io-client in /examples/latenc...
    • d196f6a chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#660)
    • 7c1270f chore(deps): bump nanoid from 3.1.25 to 3.3.1 (#659)
    • 535a01d ci: add Node.js 18 in the test matrix
    • 1b71a6f docs: remove "Vanilla JS" highlight from README (#656)
    • 917d1d2 refactor: replace deprecated String.prototype.substr() (#646)
    • 020801a chore: add changelog for version 3.6.0
    • ed1d6f9 test: make test script work on Windows (#643)
    • Additional commits viewable in compare view

    Updates socket.io from 4.4.1 to 4.5.3

    Release notes

    Sourced from socket.io's releases.

    4.5.3

    Bug Fixes

    • typings: accept an HTTP2 server in the constructor (d3d0a2d)
    • typings: apply types to "io.timeout(...).emit()" calls (e357daf)

    Links:

    4.5.2

    Bug Fixes

    • prevent the socket from joining a room after disconnection (18f3fda)
    • uws: prevent the server from crashing after upgrade (ba497ee)

    Links:

    4.5.1

    Bug Fixes

    • forward the local flag to the adapter when using fetchSockets() (30430f0)
    • typings: add HTTPS server to accepted types (#4351) (9b43c91)

    Links:

    4.5.0

    Bug Fixes

    • typings: ensure compatibility with TypeScript 3.x (#4259) (02c87a8)

    Features

    • add support for catch-all listeners for outgoing packets (531104d)

    This is similar to onAny(), but for outgoing packets.

    ... (truncated)

    Changelog

    Sourced from socket.io's changelog.

    4.5.3 (2022-10-15)

    Bug Fixes

    • typings: accept an HTTP2 server in the constructor (d3d0a2d)
    • typings: apply types to "io.timeout(...).emit()" calls (e357daf)

    4.5.2 (2022-09-02)

    Bug Fixes

    • prevent the socket from joining a room after disconnection (18f3fda)
    • uws: prevent the server from crashing after upgrade (ba497ee)

    2.5.0 (2022-06-26)

    Bug Fixes

    • fix race condition in dynamic namespaces (05e1278)
    • ignore packet received after disconnection (22d4bdf)
    • only set 'connected' to true after middleware execution (226cc16)
    • prevent the socket from joining a room after disconnection (f223178)

    4.5.1 (2022-05-17)

    Bug Fixes

    • forward the local flag to the adapter when using fetchSockets() (30430f0)
    • typings: add HTTPS server to accepted types (#4351) (9b43c91)

    4.5.0 (2022-04-23)

    Bug Fixes

    • typings: ensure compatibility with TypeScript 3.x (#4259) (02c87a8)

    ... (truncated)

    Commits
    • 945c84b chore(release): 4.5.3
    • d3d0a2d fix(typings): accept an HTTP2 server in the constructor
    • 19b225b docs(examples): update dependencies of the basic CRUD example
    • 8fae95d docs: add jsdoc for each public method
    • e6f6b90 docs: add deprecation notice for the allSockets() method
    • 596eb88 ci: upgrade to actions/checkout@3 and actions/setup-node@3
    • e357daf fix(typings): apply types to "io.timeout(...).emit()" calls
    • 10fa4a2 refactor: add list of possible disconnection reasons
    • 8be95b3 chore(release): 4.5.2
    • ba497ee fix(uws): prevent the server from crashing after upgrade
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump moment from 2.29.2 to 2.29.4

    Bump moment from 2.29.2 to 2.29.4

    Bumps moment from 2.29.2 to 2.29.4.

    Changelog

    Sourced from moment's changelog.

    2.29.4

    • Release Jul 6, 2022
      • #6015 [bugfix] Fix ReDoS in preprocessRFC2822 regex

    2.29.3 Full changelog

    • Release Apr 17, 2022
      • #5995 [bugfix] Remove const usage
      • #5990 misc: fix advisory link
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Uncaught TypeError: Cannot read property '_adapters' of undefined

    Uncaught TypeError: Cannot read property '_adapters' of undefined

    Hello maintainers!

    I am working with Chart.js and Chartjs-adapter-moment to display a historical trend of up to 19 datasets using Flask. I am running into the issue where the adapter is returning the below error:

    Uncaught TypeError: Cannot read property '_adapters' of undefined at chartjs-adapter-moment.min.js:formatted:29 at chartjs-adapter-moment.min.js:formatted:8 at chartjs-adapter-moment.min.js:formatted:9

    As well as this additional chart.js error:

    Uncaught TypeError: Cannot read property 'left' of undefined at _isPointInArea (chart.js:1339) at getNearestItems (chart.js:1775) at nearest (chart.js:1858) at Chart.getElementsAtEventForMode (chart.js:6857) at Chart._handleEvent (chart.js:7091) at Chart._eventHandler (chart.js:7074) at listener (chart.js:6971) at Chart.event (chart.js:2431) at chart.js:34

    Versions: Chart.js 3.2.0 Moment.js 2.29.1 Chartjs-adapter-momentjs 1.0.0

    The time format is ISO 8601, and I had the implementation working on Chart.js version 2.6.0 but I needed to upgrade to get the zoom plugin to work. And now the chart will not build with the two above errors.

    opened by dclark3774 4
  • [BUG] Deprecation Warning - from moment.js when using time axes

    [BUG] Deprecation Warning - from moment.js when using time axes

    Expected Behavior

    Current Behavior

    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: 2018.01.01, _f: undefined, _strict: undefined, _locale: [object Object]
    Error
        at Function.createFromInputFallback (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:320:98)
        at configFromString (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2368:15)
        at configFromInput (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2594:13)
        at prepareConfig (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2577:13)
        at createFromConfig (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2544:44)
        at createLocalOrUTC (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2631:16)
        at createLocal (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:2635:16)
        at hooks (http://127.0.0.1:8000/static/documerge/node_modules/moment/moment.js?v=1523389320944:12:29)
        at momentify (http://127.0.0.1:8000/static/documerge/node_modules/chart.js/dist/Chart.js?v=1523389320944:13795:11)
        at parse (http://127.0.0.1:8000/static/documerge/node_modules/chart.js/dist/Chart.js?v=1523389320944:13817:14)
    warn @ moment.js?v=1523389320944:293
    (anonymous) @ moment.js?v=1523389320944:320
    configFromString @ moment.js?v=1523389320944:2368
    configFromInput @ moment.js?v=1523389320944:2594
    prepareConfig @ moment.js?v=1523389320944:2577
    createFromConfig @ moment.js?v=1523389320944:2544
    createLocalOrUTC @ moment.js?v=1523389320944:2631
    createLocal @ moment.js?v=1523389320944:2635
    hooks @ moment.js?v=1523389320944:12
    momentify @ Chart.js?v=1523389320944:13795
    parse @ Chart.js?v=1523389320944:13817
    determineDataLimits @ Chart.js?v=1523389320944:14149
    update @ Chart.js?v=1523389320944:7230
    update @ Chart.js?v=1523389320944:14109
    getMinimumBoxSize @ Chart.js?v=1523389320944:6416
    each @ Chart.js?v=1523389320944:9899
    update @ Chart.js?v=1523389320944:6430
    updateLayout @ Chart.js?v=1523389320944:4259
    update @ Chart.js?v=1523389320944:4214
    construct @ Chart.js?v=1523389320944:3944
    Chart @ Chart.js?v=1523389320944:6215
    

    image

    Possible Solution

    Moment.js might deprecate the functionality. Unless provided date format along with date. like moment(value, format) in #13795 form the above screenshot

    Steps to Reproduce (for bugs)

    1. Configure to time axis
    {
    type: "line",
    data: {
                // labels: ["Used", "Remaining"],
                datasets: [{
                    label: 'Test Merges',
                    xAxisID: "time",
                    fill: true,
                    lineTension: 0,
                    data: [
                        {x: '01-01-2018', y:10},
                        {x: '02-01-2018', y:5},
                        {x: '02-05-2018', y:15}
                    ]
                }]
            },
    config: {
                scales: {
                   xAxes: [{
                        id: 'time',
                        type: 'time',
                        time: {
                            tooltipFormat: "DD MMMM, YYYY"
                        }
                    }]
                }
            };
        }
    }
    

    Environment

    • Chart.js version: "^2.7.2",
    • Chrome 65.0.3325.181
    opened by tiholic 8
Releases(v1.0.1)
Owner
Chart.js
Simple, clean and engaging charts for designers and developers
Chart.js
Luxon adapter for Chart.js

chartjs-adapter-luxon Overview This adapter allows the use of Luxon with Chart.js. Luxon provides built-in support for time zones and internationaliza

Chart.js 26 Dec 20, 2022
date-fns adapter for Chart.js

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.

Chart.js 71 Dec 22, 2022
A Simple Dashboard Chart in Laravel Nova using Chart JS

A Simple Dashboard Chart in Laravel Nova using Chart JS. Starting create your own dashboard with Chart JS Integration can save your time and help you maintain consistency across standard elements such as Bar, Stacked, Line, Area, Doughnut and Pie Chart.

Kuncoro Wicaksono 177 Jan 4, 2023
Chart.js plugin to defer initial chart updates

Chart.js plugin to defer initial chart updates until the user scrolls and the canvas appears inside the viewport, and thus trigger the initial chart a

Chart.js 97 Nov 9, 2022
Bar Funnel Chart extension for Chart.js

Chart.BarFunnel.js Provides a Bar Funnel Chart for use with Chart.js Documentation To create a Bar Funnel Chart, include Chart.BarFunnel.js after Char

Chart.js 58 Nov 24, 2022
TradeX-chart is a trade chart written in plain (vanilla) JavaScript with minimal dependencies

TradeX-chart is a trade chart written in plain (vanilla) JavaScript with minimal dependencies; use it with any framework or backend.

null 24 Dec 12, 2022
Java library for use with Chart.js javascript library

Chart.java Chart.java enables integration with the excellent Chart.js library from within a Java application. Usage example In Java: BarDataset datase

Marceau Dewilde 102 Dec 16, 2022
Redefined chart library built with React and D3

Recharts Introduction Recharts is a Redefined chart library built with React and D3. The main purpose of this library is to help you to write charts i

recharts 19.4k Jan 2, 2023
:bar_chart: A D3-based reusable chart library

c3 c3 is a D3-based reusable chart library that enables deeper integration of charts into web applications. Follow the link for more information: http

C3.js 9.2k Jan 2, 2023
GPL version of Javascript Gantt Chart

dhtmlxGantt Getting started | Features | Follow us | License | Useful links dhtmlxGantt is an open source JavaScript Gantt chart that helps you illust

null 952 Dec 29, 2022
🍞📊 Beautiful chart for data visualization.

?? ?? Spread your data on TOAST UI Chart. TOAST UI Chart is Beautiful Statistical Data Visualization library. ?? Packages The functionality of TOAST U

NHN 5.2k Jan 2, 2023
:bar_chart: Re-usable, easy interface JavaScript chart library based on D3.js

billboard.js is a re-usable, easy interface JavaScript chart library, based on D3 v4+. The name "billboard" comes from the famous billboard chart whic

NAVER 5.4k Jan 1, 2023
:bar_chart: A library of modular chart components built on D3

Plottable Plottable is a library of chart components for creating flexible, custom charts for websites. It is built on top of D3.js and provides highe

Palantir Technologies 2.9k Dec 31, 2022
Chart image and QR code web API

QuickChart QuickChart is a service that generates images of charts from a URL. Because these charts are simple images, they are very easy to embed in

Ian Webster 1.3k Dec 25, 2022
📈 A small, fast chart for time series, lines, areas, ohlc & bars

?? μPlot A small (~35 KB min), fast chart for time series, lines, areas, ohlc & bars (MIT Licensed) Introduction μPlot is a fast, memory-efficient Can

Leon Sorokin 7.5k Jan 7, 2023
TChart.js - simple and configurable Bar and Line Chart library in Javascript

TChart.js Simple and configurable Bar and Line Chart library in Javascript Description TChart.js is a canvas-based simple Javascript Bar and Line Char

null 4 Mar 3, 2021
🍞📊 Beautiful chart for data visualization.

?? ?? Spread your data on TOAST UI Chart. TOAST UI Chart is Beautiful Statistical Data Visualization library. ?? Packages The functionality of TOAST U

NHN 5.2k Jan 6, 2023
The power of Chart.js in Jupyter !

The power of Chart.js in Jupyter Notebooks Installation You can install ipychart from your terminal using pip or conda: # using pip $ pip install ipyc

Nicolas H 68 Dec 8, 2022
Chart.js bindings for OCaml

chartjs-ocaml: OCaml bindings for Chart.js This library provides OCaml bindings for the Chart.js charting library and some popular plugins. Following

Alex Yanin 13 Aug 20, 2022