0π
β
The only way I managed to achieve this was formatting the date inside my controller before sending it to my view. I will post code later when Iβm not at work π
1π
I would say format it in ChartJS
itself if your purely looking to change it as part of the presentation. If you look at this question we see that we can format our labels for data points using something like.
scaleLabel: function (valuePayload) {
return Number(valuePayload.value).toFixed(2).replace('.',',') + '$';
}
now in your case you could maybe do something like
scaleLabel: function (value) {
return moment(value).format("ddd, hA"); ;
}
to format date in a nice way. Making use of momentjs in this case.
Warning: Above is not tested Iβve never done this with ChartJS
but in theory it should work.
Source:stackexchange.com