From 59eb6eaa168e63ba88eeb40273b2869429dee8fe Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 15 Dec 2020 19:40:27 -0800 Subject: [PATCH] Do not format date, just pass raw date object to chart. Closes https://github.com/owncast/owncast/issues/459 --- web/pages/components/chart.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/pages/components/chart.tsx b/web/pages/components/chart.tsx index 8d8f7609b..3efae8ecc 100644 --- a/web/pages/components/chart.tsx +++ b/web/pages/components/chart.tsx @@ -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; }