getFullYear() in callback returning incorrect year

Hi everyone,

I have a callback that looks like this which always works properly with ChartJS directly and sometimes it works with QuickChart, but other times, it always returns 2001. I have tested with v2 and v4 (I am using v4 directly with ChartJS so initially thought there might be some v2 bug).

Are there any known issues or any thoughts on why this might be happening.

Thanks.

ticks: {
    callback: function(value, index, ticks) {
        const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
        var d = new Date(value);
        return d.getDate() + ' ' + monthNames[d.getMonth()] + ' ' + d.getFullYear();
    }
}

Hi @Adrian,

This is an interesting one… do you have a full example of a chart that returns the wrong year? I’m particularly interested in what value is in this case.

Ian