Browse Source

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

pull/1886/head
Gabe Kangas 6 years ago
parent
commit
59eb6eaa16
  1. 3
      web/pages/components/chart.tsx

3
web/pages/components/chart.tsx

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

Loading…
Cancel
Save