initialized/typed (some) variables

master
Stuff-etc 2024-03-25 17:03:52 +01:00
parent fb1edc5abd
commit aa015893ae
1 changed files with 4 additions and 4 deletions

View File

@ -28,11 +28,11 @@ var monthOffset = 0;
* Calendar features * Calendar features
*/ */
function drawFullCalendar(monthOffset) { function drawFullCalendar(monthOffset) {
addMonths = function (_d, _am) { const addMonths = function (_d, _am) {
var ay = 0, m = _d.getMonth(), y = _d.getFullYear(); let ay = 0, m = _d.getMonth(), y = _d.getFullYear();
while ((m + _am) > 11) { ay++; _am -= 12; } while ((m + _am) > 11) { ay++; _am -= 12; }
while ((m + _am) < 0) { 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.setMonth(m + _am);
n.setFullYear(y + ay); n.setFullYear(y + ay);
return n; return n;
@ -45,7 +45,7 @@ function drawFullCalendar(monthOffset) {
if (typeof dayInterval !== "undefined") clearTimeout(dayInterval); if (typeof dayInterval !== "undefined") clearTimeout(dayInterval);
if (typeof secondInterval !== "undefined") clearTimeout(secondInterval); if (typeof secondInterval !== "undefined") clearTimeout(secondInterval);
if (typeof minuteInterval !== "undefined") clearTimeout(minuteInterval); if (typeof minuteInterval !== "undefined") clearTimeout(minuteInterval);
d = addMonths(Date(), monthOffset); var d = addMonths(Date(), monthOffset);
tdy = Date().getDate() + "." + Date().getMonth(); tdy = Date().getDate() + "." + Date().getMonth();
newmonth = false; newmonth = false;
c_y = 0; c_y = 0;