calendar: Fix scope of let variables

master
Erik Andresen 2022-06-02 19:39:42 +02:00
parent ac5c80ff38
commit 602ffee601
3 changed files with 14 additions and 14 deletions

View File

@ -7,3 +7,4 @@
0.07: Fix off-by-one-error on previous month
0.08: Do not register as watch, manually start clock on button
read start of week from system settings
0.09: Fix scope of let variables

View File

@ -16,6 +16,12 @@ const white = "#ffffff";
const red = "#d41706";
const blue = "#0000ff";
const yellow = "#ffff00";
let bgColor = color4;
let bgColorMonth = color1;
let bgColorDow = color2;
let bgColorWeekend = color3;
let fgOtherMonth = gray1;
let fgSameMonth = white;
let settings = require('Storage').readJSON("calendar.json", true) || {};
let startOnSun = ((require("Storage").readJSON("setting.json", true) || {}).firstDayOfWeek || 0) === 0;
@ -27,19 +33,12 @@ if (settings.ndColors === undefined)
}
if (settings.ndColors === true) {
let bgColor = white;
let bgColorMonth = blue;
let bgColorDow = black;
let bgColorWeekend = yellow;
let fgOtherMonth = blue;
let fgSameMonth = black;
} else {
let bgColor = color4;
let bgColorMonth = color1;
let bgColorDow = color2;
let bgColorWeekend = color3;
let fgOtherMonth = gray1;
let fgSameMonth = white;
bgColor = white;
bgColorMonth = blue;
bgColorDow = black;
bgColorWeekend = yellow;
fgOtherMonth = blue;
fgSameMonth = black;
}
function getDowLbls(locale) {

View File

@ -1,7 +1,7 @@
{
"id": "calendar",
"name": "Calendar",
"version": "0.08",
"version": "0.09",
"description": "Simple calendar",
"icon": "calendar.png",
"screenshots": [{"url":"screenshot_calendar.png"}],