From 6435c684fdedac4f8c4b554bed145940590f82d2 Mon Sep 17 00:00:00 2001 From: Danny <31635744+DDDanny@users.noreply.github.com> Date: Sat, 2 Apr 2022 11:51:59 +0200 Subject: [PATCH 1/3] replaced substr(ing) by slice --- apps/antonclk/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/antonclk/app.js b/apps/antonclk/app.js index 7b40d8eb5..6197d66aa 100644 --- a/apps/antonclk/app.js +++ b/apps/antonclk/app.js @@ -99,7 +99,7 @@ function updateState() { } function isoStr(date) { - return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).substr(-2) + "-" + ("0" + date.getDate()).substr(-2); + return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).substr(-2); } var calWeekBuffer = [false,false,false]; //buffer tz, date, week no (once calculated until other tz or date is requested) @@ -140,7 +140,7 @@ function draw() { g.setFontAlign(0, 0).setFont("Anton").drawString(timeStr, x, y); // draw time if (secondsScreen) { y += 65; - var secStr = (secondsWithColon ? ":" : "") + ("0" + date.getSeconds()).substr(-2); + var secStr = (secondsWithColon ? ":" : "") + ("0" + date.getSeconds()).slice(-2); if (doColor()) g.setColor(0, 0, 1); g.setFont("AntonSmall"); @@ -193,7 +193,7 @@ function draw() { if (calWeek || weekDay) { var dowcwStr = ""; if (calWeek) - dowcwStr = " #" + ("0" + ISO8601calWeek(date)).substring(-2); + dowcwStr = " #" + ("0" + ISO8601calWeek(date)).slice(-2); if (weekDay) dowcwStr = require("locale").dow(date, calWeek ? 1 : 0) + dowcwStr; //weekDay e.g. Monday or weekDayShort # e.g. Mon #01 else //week #01 From 42c6f3b1b96404e0ef99fbc36453b3eb310a54b5 Mon Sep 17 00:00:00 2001 From: Danny <31635744+DDDanny@users.noreply.github.com> Date: Sat, 2 Apr 2022 11:52:53 +0200 Subject: [PATCH 2/3] replaced substr by slice --- apps/antonclk/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/antonclk/app.js b/apps/antonclk/app.js index 6197d66aa..4b1e71bda 100644 --- a/apps/antonclk/app.js +++ b/apps/antonclk/app.js @@ -99,7 +99,7 @@ function updateState() { } function isoStr(date) { - return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).substr(-2); + return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2); } var calWeekBuffer = [false,false,false]; //buffer tz, date, week no (once calculated until other tz or date is requested) From 290dcfec3b306ea9c704cb39919c8a27171a2a2b Mon Sep 17 00:00:00 2001 From: Danny <31635744+DDDanny@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:05:33 +0200 Subject: [PATCH 3/3] changed to v0.08 --- apps/antonclk/ChangeLog | 3 ++- apps/antonclk/metadata.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/antonclk/ChangeLog b/apps/antonclk/ChangeLog index ac49dcbd7..73a63f7c7 100644 --- a/apps/antonclk/ChangeLog +++ b/apps/antonclk/ChangeLog @@ -8,4 +8,5 @@ 0.06: fixes #1271 - wrong settings name when weekday name and calendar weeknumber are on then display is # week is buffered until date or timezone changes -0.07: align default settings with app.js (otherwise the initial displayed settings will be confusing to users) \ No newline at end of file +0.07: align default settings with app.js (otherwise the initial displayed settings will be confusing to users) +0.08: fixed calendar weeknumber not shortened to two digits \ No newline at end of file diff --git a/apps/antonclk/metadata.json b/apps/antonclk/metadata.json index 4d26dd0c7..c58ee2a1b 100644 --- a/apps/antonclk/metadata.json +++ b/apps/antonclk/metadata.json @@ -1,7 +1,7 @@ { "id": "antonclk", "name": "Anton Clock", - "version": "0.07", + "version": "0.08", "description": "A clock using the bold Anton font, optionally showing seconds and date in ISO-8601 format.", "readme":"README.md", "icon": "app.png",