https://github.com/schummar/chartjs-adapter-temporal
https://github.com/schummar/chartjs-adapter-temporal
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/schummar/chartjs-adapter-temporal
- Owner: schummar
- License: mit
- Created: 2024-02-27T16:12:36.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T22:36:39.000Z (over 1 year ago)
- Last Synced: 2025-10-04T15:58:00.326Z (7 months ago)
- Language: TypeScript
- Size: 275 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - temporal
README
[](https://www.npmjs.com/package/chartjs-adapter-temporal)

Time adapter for Chart.js using the [Temporal API](https://github.com/tc39/proposal-temporal) (Stage 3 proposal) and the [Intl.DateTimeFormat API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
# Getting started
## Install
```
npm install chartjs-adapter-temporal
```
## Polyfill
Currently the Temporal API is not yet available in browsers. You can install one of multiple polyfills to use this adapter:
- [@js-temporal/polyfill
](https://www.npmjs.com/package/@js-temporal/polyfill)
- [temporal-polyfill](https://www.npmjs.com/package/temporal-polyfill)
## Register the adapter
Either explicitly register the adapter:
```ts
import { _adapters } from 'chart.js/auto';
import temporalAdapter from 'chartjs-adapter-temporal';
_adapters._date.override(temporalAdapter);
```
Or use the `register` import:
```ts
import 'chartjs-adapter-temporal/register';
```