[Nifty-A Clock] Read settings file via ClockFace

pull/1938/head
Alessandro Cocco 2022-06-08 21:03:39 +02:00
parent 955bff9e52
commit b793e7d6e4
1 changed files with 2 additions and 3 deletions

View File

@ -33,8 +33,6 @@ const clock = new ClockFace({
this.scale = g.getWidth() / this.viewport.width;
this.centerTimeScaleX = this.center.x + 32 * this.scale;
this.centerDatesScaleX = this.center.x + 40 * this.scale;
this.showWeekNum = Object.assign({ showWeekNum: true }, require("Storage").readJSON("ffcniftya.json", true))["showWeekNum"];
},
draw: function (date) {
const hour = date.getHours() - (this.is12Hour && date.getHours() > 12 ? 12 : 0);
@ -55,6 +53,7 @@ const clock = new ClockFace({
if (this.showWeekNum) g.drawString(format(ISO8601_week_no(date)), this.centerDatesScaleX, this.center.y + 15 * this.scale);
g.drawString(monthName, this.centerDatesScaleX, this.center.y + 48 * this.scale);
g.drawString(dayName, this.centerDatesScaleX, this.center.y + 66 * this.scale);
}
},
settingsFile: "ffcniftya.json"
});
clock.start();