Skip to content

Commit

Permalink
Use let and const
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 1, 2024
1 parent 873f724 commit ad7fce1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@
);
}

dateParam = getURLParameter("date");
var date;
let dateParam = getURLParameter("date");
let date;
if (dateParam !== "null") {
dateParam = dateParam.replace(/\+/g, "-"); // Replace all + with -
date = new Date(dateParam);
} else {
date = new Date(); // Today
}

why = why_are_the_flags_up(date);
const why = why_are_the_flags_up(date);
const flags_up = why[0];
const intro = why[1];
const reason = why[2];
Expand All @@ -137,7 +137,7 @@
$("#reason").html(reason);
$("#other_reason").html(other_reason);
if (flags_up) {
var htmlElement = document.querySelector("html");
const htmlElement = document.querySelector("html");
htmlElement.style.backgroundImage = "url(images/flag.jpg)";
$("#reason").addClass("outline");
$(".reason-container").css({ bottom: "0" });
Expand Down

0 comments on commit ad7fce1

Please sign in to comment.