Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
Signed-off-by: 1998-felix <[email protected]>
  • Loading branch information
felixgateru committed Mar 18, 2024
1 parent 28c2c8b commit 11d09c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/web/templates/charts/barchartmodal.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ <h5 class="modal-title" id="barChartModalLabel">Time Series Bar Chart</h5>
// Create an object to store the form data
let chartData = {};
let formData = new FormData(form);
for (var pair of formData.entries()) {
if (pair[0] === "startTime" || pair[0] === "stopTime") {
const inputDate = new Date(pair[1]);
chartData[pair[0]] = inputDate.getTime();
for (let [name, value] of formData) {
if (name === "startTime" || name === "stopTime") {
const inputDate = new Date(value);
chartData[name] = inputDate.getTime();
} else {
chartData[pair[0]] = pair[1];
chartData[name] = value;
}
}

Expand Down

0 comments on commit 11d09c7

Please sign in to comment.