Merge pull request #2311 from eyecreate/patch-2

Add support for local time display to slopeclockpp
master
Gordon Williams 2022-11-28 10:08:21 +00:00 committed by GitHub
commit 172c73ed1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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();

View File

@ -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"}],