From aa015893ae9229db72b77e6155da7b4e9b97142d Mon Sep 17 00:00:00 2001 From: Stuff-etc Date: Mon, 25 Mar 2024 17:03:52 +0100 Subject: [PATCH] initialized/typed (some) variables --- apps/clockcal/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/clockcal/app.js b/apps/clockcal/app.js index 2ffdde504..4e9c8e01a 100644 --- a/apps/clockcal/app.js +++ b/apps/clockcal/app.js @@ -28,11 +28,11 @@ var monthOffset = 0; * Calendar features */ function drawFullCalendar(monthOffset) { - addMonths = function (_d, _am) { - var ay = 0, m = _d.getMonth(), y = _d.getFullYear(); + const addMonths = function (_d, _am) { + let ay = 0, m = _d.getMonth(), y = _d.getFullYear(); while ((m + _am) > 11) { ay++; _am -= 12; } while ((m + _am) < 0) { ay--; _am += 12; } - n = new Date(_d.getTime()); + let n = new Date(_d.getTime()); n.setMonth(m + _am); n.setFullYear(y + ay); return n; @@ -45,7 +45,7 @@ function drawFullCalendar(monthOffset) { if (typeof dayInterval !== "undefined") clearTimeout(dayInterval); if (typeof secondInterval !== "undefined") clearTimeout(secondInterval); if (typeof minuteInterval !== "undefined") clearTimeout(minuteInterval); - d = addMonths(Date(), monthOffset); + var d = addMonths(Date(), monthOffset); tdy = Date().getDate() + "." + Date().getMonth(); newmonth = false; c_y = 0;