I am trying to format the x-axis ticks using Higcharts.dateFormat.
I noticed that the values are formatted correctly when using timezon. in other words I am only getting the correct format value when my timezone is UTC. And, when I remove the timezone; I get correct result Here is my custom formatter:
Code: Select all
function axisDateFormatter() {
let chart = this;
const unitName = chart.tickPositionInfo.unitName;
let specifier;
switch (unitName) {
case "day":
specifier = "%d"; // Day as digit
break;
case "month":
specifier = "%B %Y"; // Full Month + Full year
break;
default:
specifier = chart.dateTimeLabelFormat;
break;
}
return Highcharts.dateFormat(specifier, this.value);
}
Live demo: http://jsfiddle.net/Sayed110/48mznebx/48/