Skip to content

Commit acb96b5

Browse files
authored
Merge pull request #3726 from randyheydon/bwclk12
bwclk & bwclklite: Support 12-hour time format.
2 parents 2954d51 + fe2ccfb commit acb96b5

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

apps/bwclk/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ clkinfo.addInteractive that would cause ReferenceError.
3232
0.30: Use widget_utils
3333
0.31: Use clock_info module as an app
3434
0.32: Make the border of the clock_info box extend all the way to the right of the screen.
35-
0.33: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
35+
0.33: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
36+
0.34: Support 12-hour time format

apps/bwclk/app.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,9 @@ let drawTime = function() {
239239
var y = y1;
240240
var date = new Date();
241241

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

248246
// Set y coordinates correctly
249247
y += parseInt((H - y)/2) + 5;

apps/bwclk/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "bwclk",
33
"name": "BW Clock",
4-
"version": "0.33",
4+
"version": "0.34",
55
"description": "A very minimalistic clock.",
66
"readme": "README.md",
77
"icon": "app.png",

apps/bwclklite/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ clkinfo.addInteractive that would cause ReferenceError.
3535
Remove invertion of theme as this doesn'twork very well with fastloading.
3636
Do an quick inital fillRect on theclock info area.
3737
0.33: Make the border of the clock_info box extend all the way to the right of the screen.
38-
0.34: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
38+
0.34: Fix issue rendering ClockInfos with for fg+bg color set to the same (#2749)
39+
0.35: Support 12-hour time format

apps/bwclklite/app.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,9 @@ let drawTime = function() {
199199
let y = y1;
200200
let date = new Date();
201201

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

208206
// Set y coordinates correctly
209207
y += parseInt((H - y)/2) + 5;

apps/bwclklite/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "bwclklite",
33
"name": "BW Clock Lite",
4-
"version": "0.34",
4+
"version": "0.35",
55
"description": "A very minimalistic clock. This version of BW Clock is quicker at the cost of the custom font.",
66
"readme": "README.md",
77
"icon": "app.png",

0 commit comments

Comments
 (0)