1
0
Fork 0

Merge branch 'antonclk-clock-0.05-showWeeknumber'

master
Danny 2022-01-11 00:17:42 +01:00
commit fb9a35d838
2 changed files with 5 additions and 3 deletions

View File

@ -40,7 +40,10 @@ The main menu contains several settings covering Anton clock in general.
* **Show Weekday** - Weekday is shown in the time presentation without seconds.
Weekday name depends on the current locale.
If seconds are shown, the weekday is never shown as there is not enough space on the watch face.
**Show Weeknumber** - Weeknumber (ISO-8601) is shown.
* **Show Weeknumber** - Week-number (ISO-8601) is shown. (default: Off)
If "Show Weekday" is "Off" the week-number is displayed as "week #:<num>".
If "Show Weekday" is "On" the weekday name is cut at 6th position and suffixed with ".#<week num>".
If seconds are shown, the week number is never shown as there is not enough space on the watch face.
* **Vector font** - Use the built-in vector font for dates and weekday.
This can improve readability.
Otherwise, a scaled version of the built-in 6x8 pixels font is used.

View File

@ -188,9 +188,8 @@ function draw() {
g.drawString(dateStr, x, y);
if (weekDay || calWeek) {
var dowwumStr = require("locale").dow(date);
dowwumStr = "thursday";
if (calWeek)
dowwumStr = (weekDay ? dowwumStr.substr(0,Math.min(dowwumStr.length,6)) + (dowwumStr.length>=6 ? "." : "") : "week ") + "#" + ISO8601calWeek(date);
dowwumStr = (weekDay ? dowwumStr.substr(0,Math.min(dowwumStr.length,6)) + (dowwumStr.length>=6 ? "." : "") : "week ") + "#" + ISO8601calWeek(date); //TODO: locale for "week"
if (upperCase)
dowwumStr = dowwumStr.toUpperCase();
g.drawString(dowwumStr, x, y + (vectorFont ? 26 : 16));