Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bwclk & bwclklite: Support 12-hour time format. #3726

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/bwclk/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ clkinfo.addInteractive that would cause ReferenceError.
0.30: Use widget_utils
0.31: Use clock_info module as an app
0.32: Make the border of the clock_info box extend all the way to the right of the screen.
0.33: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
0.33: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
0.34: Support 12-hour time format
8 changes: 3 additions & 5 deletions apps/bwclk/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,9 @@ let drawTime = function() {
var y = y1;
var date = new Date();

var hours = String(date.getHours());
var minutes = date.getMinutes();
minutes = minutes < 10 ? String("0") + minutes : minutes;
var colon = settings.hideColon ? "" : ":";
var timeStr = hours + colon + minutes;
var timeStr = locale.time(date, 1);
if (settings.hideColon)
timeStr = timeStr.replace(":", "");

// Set y coordinates correctly
y += parseInt((H - y)/2) + 5;
Expand Down
2 changes: 1 addition & 1 deletion apps/bwclk/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bwclk",
"name": "BW Clock",
"version": "0.33",
"version": "0.34",
"description": "A very minimalistic clock.",
"readme": "README.md",
"icon": "app.png",
Expand Down
3 changes: 2 additions & 1 deletion apps/bwclklite/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ clkinfo.addInteractive that would cause ReferenceError.
Remove invertion of theme as this doesn'twork very well with fastloading.
Do an quick inital fillRect on theclock info area.
0.33: Make the border of the clock_info box extend all the way to the right of the screen.
0.34: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
0.34: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
0.35: Support 12-hour time format
8 changes: 3 additions & 5 deletions apps/bwclklite/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,9 @@ let drawTime = function() {
let y = y1;
let date = new Date();

let hours = String(date.getHours());
let minutes = date.getMinutes();
minutes = minutes < 10 ? String("0") + minutes : minutes;
let colon = settings.hideColon ? "" : ":";
let timeStr = hours + colon + minutes;
var timeStr = locale.time(date, 1);
if (settings.hideColon)
timeStr = timeStr.replace(":", "");

// Set y coordinates correctly
y += parseInt((H - y)/2) + 5;
Expand Down
2 changes: 1 addition & 1 deletion apps/bwclklite/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bwclklite",
"name": "BW Clock Lite",
"version": "0.34",
"version": "0.35",
"description": "A very minimalistic clock. This version of BW Clock is quicker at the cost of the custom font.",
"readme": "README.md",
"icon": "app.png",
Expand Down