I am adding customCode to the export options and I am extending the dateFormats by doing something like:
customCode: 'function(){ Highcharts.dateFormats = { W: function(timestamp) { return "custom" } }; }'
This works just fine by formatting every "%W" label to "custom". Fine. However, I would like to format dates by using moment.js. Is there any way to add an external module to the customCode? Also, is there any way to do this in some other way?
So I would like to have something like:
customCode: 'function(){
Highcharts.dateFormats = {
W: function(timestamp) { return moment(timestamp).isoWeek().toString() }
};
}'
Workaround with `new Date()` is not sufficient.
I am adding
customCode
to the export options and I am extending thedateFormats
by doing something like:customCode: 'function(){ Highcharts.dateFormats = { W: function(timestamp) { return "custom" } }; }'
This works just fine by formatting every "%W" label to "custom". Fine. However, I would like to format dates by using
moment.js
. Is there any way to add an external module to the customCode? Also, is there any way to do this in some other way?So I would like to have something like: