Skip to content

Possible to have a "time" Scale when using Chart.js via ESM with no npm or bundler? #10355

Answered by frou
frou asked this question in Q&A
Discussion options

You must be logged in to vote

I have found a way to get this working, but only by making a copy of the file chartjs-adapter-date-fns.esm.js into one's own repo and doing some minor surgery on it:

diff --git a/chartjs-adapter-date-fns.esm.js b/setup-date-adapter.js
index b829e10..7f579b4 100644
--- a/chartjs-adapter-date-fns.esm.js
+++ b/setup-date-adapter.js
@@ -4,8 +4,7 @@
  * (c) 2021 chartjs-adapter-date-fns Contributors
  * Released under the MIT license
  */
-import { _adapters } from 'chart.js';
-import { toDate, parse, parseISO, isValid, format, addYears, addQuarters, addMonths, addWeeks, addDays, addHours, addMinutes, addSeconds, addMilliseconds, differenceInYears, differenceInQuarters, differenceInMonths, dif…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant