diff --git a/assets/js/dashboard/stats/visitor-graph.js b/assets/js/dashboard/stats/visitor-graph.js index cb2eb087b..d59beb74a 100644 --- a/assets/js/dashboard/stats/visitor-graph.js +++ b/assets/js/dashboard/stats/visitor-graph.js @@ -100,13 +100,14 @@ class LineGraph extends React.Component { backgroundColor: 'rgba(25, 30, 56)', callbacks: { title: function(dataPoints) { - var data = dataPoints[0] + const data = dataPoints[0] + const formatDate = dateFormatter(graphData) if (graphData.interval === 'month') { - return data.yLabel.toLocaleString() + ' visitors in ' + data.xLabel + return data.yLabel.toLocaleString() + ' visitors in ' + formatDate(data.xLabel) } else if (graphData.interval === 'date') { - return data.yLabel.toLocaleString() + ' visitors on ' + data.xLabel + return data.yLabel.toLocaleString() + ' visitors on ' + formatDate(data.xLabel) } else if (graphData.interval === 'hour') { - return data.yLabel.toLocaleString() + ' visitors at ' + data.xLabel + return data.yLabel.toLocaleString() + ' visitors at ' + formatDate(data.xLabel) } }, label: function() {},