From bdd1dc018d87443e45865f31787b8d6542cc068e Mon Sep 17 00:00:00 2001 From: Stefan Kuehnel Date: Sun, 24 May 2020 14:39:12 +0200 Subject: [PATCH] Changed code for reading settings. --- apps.json | 2 +- apps/berlinc/berlin-clock.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps.json b/apps.json index 4e967ba22..0b2a51d27 100644 --- a/apps.json +++ b/apps.json @@ -887,7 +887,7 @@ { "id": "berlinc", "name": "Berlin Clock", "icon": "berlin-clock.png", - "version":"0.03.04", + "version":"0.03.05", "description": "Berlin Clock (see https://en.wikipedia.org/wiki/Mengenlehreuhr)", "tags": "clock", "type":"clock", diff --git a/apps/berlinc/berlin-clock.js b/apps/berlinc/berlin-clock.js index a1ce5a90c..3bc04cd08 100644 --- a/apps/berlinc/berlin-clock.js +++ b/apps/berlinc/berlin-clock.js @@ -5,14 +5,14 @@ const width = g.getWidth() - 2 * offset; const height = g.getHeight() - 2 * offset; const rowHeight = height / 4; -const show_date = (require('Storage').readJSON('berlin-clock.json', 1) || {})['showdate']; +const show_date = require("Storage").readJSON('berlin-clock.json')['showdate']; rowlights = []; function drawBerlinClock() { g.clear(); var now = new Date(); - /* + if (show_date) { var yr = now.getFullYear(); var month = now.getMonth() + 1; @@ -22,7 +22,7 @@ function drawBerlinClock() { g.setColor(1, 1, 1); g.drawString(dateString, ( g.getWidth() - strWidth ) / 2, height + offset + 2); } - */ + rowlights[0] = Math.floor(now.getHours() / 5); rowlights[1] = now.getHours() % 5; rowlights[2] = Math.floor(now.getMinutes() / 5);