Do not format date, just pass raw date object to chart. Closes https://github.com/owncast/owncast/issues/459

This commit is contained in:
Gabe Kangas 2020-12-15 19:40:27 -08:00
parent 69f8efba94
commit 59eb6eaa16

View file

@ -19,8 +19,7 @@ function createGraphDataset(dataArray) {
const dataValues = {}; const dataValues = {};
dataArray.forEach(item => { dataArray.forEach(item => {
const dateObject = new Date(item.time); const dateObject = new Date(item.time);
const dateString = `${dateObject.getFullYear() }-${ dateObject.getMonth() }-${ dateObject.getDay() } ${ dateObject.getHours() }:${ dateObject.getMinutes()}`; dataValues[dateObject] = item.value;
dataValues[dateString] = item.value;
}) })
return dataValues; return dataValues;
} }