From ddab4bc3c086fcfc586914504cb30b2aa3f27ec4 Mon Sep 17 00:00:00 2001 From: kshitijrajsharma Date: Tue, 20 Aug 2024 12:53:38 +0545 Subject: [PATCH] remove timestamp param from date --- main.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 8fb32c4..621dd54 100644 --- a/main.js +++ b/main.js @@ -107,10 +107,16 @@ function fetchData() { }) .then((response) => response.json()) .then((data) => { - chartData = data; - createMetricSelectors(data[0]); - createChart(data); - createTable(data); + const processedData = data.map((item) => { + if (item.kwdate) { + item.kwdate = item.kwdate.split("T")[0]; + } + return item; + }); + chartData = processedData; + createMetricSelectors(processedData[0]); + createChart(processedData); + createTable(processedData); document.getElementById("downloadBtn").style.display = "block"; document.getElementById("chartmetricselector").style.display = "block"; })