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.07: Fix off-by-one-error on previous month
0.08: Do not register as watch, manually start clock on button 0.08: Do not register as watch, manually start clock on button
read start of week from system settings 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 red = "#d41706";
const blue = "#0000ff"; const blue = "#0000ff";
const yellow = "#ffff00"; 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 settings = require('Storage').readJSON("calendar.json", true) || {};
let startOnSun = ((require("Storage").readJSON("setting.json", true) || {}).firstDayOfWeek || 0) === 0; let startOnSun = ((require("Storage").readJSON("setting.json", true) || {}).firstDayOfWeek || 0) === 0;
@ -27,19 +33,12 @@ if (settings.ndColors === undefined)
} }
if (settings.ndColors === true) { if (settings.ndColors === true) {
let bgColor = white; bgColor = white;
let bgColorMonth = blue; bgColorMonth = blue;
let bgColorDow = black; bgColorDow = black;
let bgColorWeekend = yellow; bgColorWeekend = yellow;
let fgOtherMonth = blue; fgOtherMonth = blue;
let fgSameMonth = black; fgSameMonth = black;
} else {
let bgColor = color4;
let bgColorMonth = color1;
let bgColorDow = color2;
let bgColorWeekend = color3;
let fgOtherMonth = gray1;
let fgSameMonth = white;
} }
function getDowLbls(locale) { function getDowLbls(locale) {

View File

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