[Chartjs]-Change date format in tooltip of chart.js

5👍

You need to define time.tooltipFormat for your xAxis.

See Moment.js for the allowed format tokens.

options: {
    ...
    scales: {
        xAxes: [{
            type: 'time',
            time: {
                unit: 'hour',
                tooltipFormat: 'DD.MM.YYYY - HH:mm' 
            }
            ...
        }]
    }
    ... 
}

Leave a comment