I'm trying to set custom date formatting on Google Timeline Chart. I have working examples for other chart types and documentation, but this does not seem to work for timelines.
for (var i = 0, len = container.clientWidth / 90; i <= len; i++) {
var realDate = START + (END - START) * i / len;
ticks.push({
v: new Date(realDate * 1000),
f: moment.unix(realDate).format(formatStr)
});
}
chart.draw(dataTable, {
hAxis: {
minValue: st,
maxValue: en,
ticks: ticks
},
});
The not working part seems to be
ticks.push({
v: new Date(realDate * 1000),
f: moment.unix(realDate).format(formatStr)
});