I have been using
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="23404b4251570d495063110d1a0d17">[email protected]</a>
with <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0c6c5d59dd3d8d1c2c4dac3f0839e859e81">[email protected]</a>
and attempting to format dates in my options like this:
scales: {
xAxes: [ {
type: 'time',
time: {
unit: 'full',
displayFormats: {
'full': 'DD/MM/YYYY HH:mm:ss'
}
}
}
],
}
Unfortunately, it is not working. I believe I need to include moment.js
or chartjs-adapter-moment
, but since vue-chartjs
is a third-party library that cannot be altered, I am unsure how to proceed without the option to add moment.js
. Any suggestions?
EDIT 1:
I attempted the following solutions:
import Chart from 'chart.js';
import adapter from 'chartjs-adapter-moment';
Chart.plugins.register(adapter);
import { Line, mixins } from 'vue-chartjs';
And also tried:
import Chart from 'chart.js';
import 'chartjs-adapter-moment';
import { Line, mixins } from 'vue-chartjs';
Neither of these methods helped.
EDIT 2:
I also tried:
import Chart from 'chart.js';
import adapter from 'chartjs-adapter-moment';
Chart.register(adapter);
import { Line, mixins } from 'vue-chartjs';
Additionally, I added the following line to BaseCharts.js
within the node-modules
folder after importing Chart
:
import 'chartjs-adapter-moment'
Unfortunately, this approach also did not work.