diff --git a/apps/slopeclockpp/ChangeLog b/apps/slopeclockpp/ChangeLog index b5e455f78..9ae4ccc96 100644 --- a/apps/slopeclockpp/ChangeLog +++ b/apps/slopeclockpp/ChangeLog @@ -5,3 +5,4 @@ Made fonts smaller to avoid overlap when (eg) 22:00 Allowed black/white background (as that can look nice too) 0.05: Images in clkinfo are optional now +0.06: Added support for locale based time diff --git a/apps/slopeclockpp/app.js b/apps/slopeclockpp/app.js index 013c25733..bf719344e 100644 --- a/apps/slopeclockpp/app.js +++ b/apps/slopeclockpp/app.js @@ -51,8 +51,9 @@ let draw = function() { x = R.w / 2; y = R.y + R.h / 2 - 12; // 12 = room for date var date = new Date(); - var hourStr = date.getHours(); - var minStr = date.getMinutes().toString().padStart(2,0); + var local_time = require("locale").time(date, 1); + var hourStr = local_time.split(":")[0].trim().padStart(2,'0'); + var minStr = local_time.split(":")[1].trim().padStart(2, '0'); dateStr = require("locale").dow(date, 1).toUpperCase()+ " "+ require("locale").date(date, 0).toUpperCase(); diff --git a/apps/slopeclockpp/metadata.json b/apps/slopeclockpp/metadata.json index b419ef898..bebed4b71 100644 --- a/apps/slopeclockpp/metadata.json +++ b/apps/slopeclockpp/metadata.json @@ -1,6 +1,6 @@ { "id": "slopeclockpp", "name": "Slope Clock ++", - "version":"0.05", + "version":"0.06", "description": "A clock where hours and minutes are divided by a sloping line. When the minute changes, the numbers slide off the screen. This is a clone of the original Slope Clock which shows extra information and allows the colors to be selected.", "icon": "app.png", "screenshots": [{"url":"screenshot.png"}],