From 83a937294fc13c0038e54d55b0fd487860e1d01a Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Sun, 4 Jul 2021 10:52:09 +0300 Subject: [PATCH 1/2] fix sunrise when it's tomorrow --- source/DataFields.mc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/DataFields.mc b/source/DataFields.mc index 2f2cf216..514a347a 100644 --- a/source/DataFields.mc +++ b/source/DataFields.mc @@ -643,7 +643,7 @@ class DataFields extends Ui.Drawable { if (tomorrow) { now = now.add(new Time.Duration(24 * 60 * 60)); } - var d = Gregorian.info(Time.now(), Time.FORMAT_SHORT); + var d = Gregorian.info(now, Time.FORMAT_SHORT); var rad = Math.PI / 180.0d; var deg = 180.0d / Math.PI; From b7a37121f7a8edee66e6de829cea3fd4a697b40a Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Sun, 4 Jul 2021 15:20:21 +0300 Subject: [PATCH 2/2] switch from "a/p" to "A/P" (minor optimization) --- always-on-source/AlwaysOnDisplay.mc | 1 - source/CrystalApp.mc | 4 ++-- source/ThickThinTime.mc | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/always-on-source/AlwaysOnDisplay.mc b/always-on-source/AlwaysOnDisplay.mc index cd8ad4d0..f719a4eb 100644 --- a/always-on-source/AlwaysOnDisplay.mc +++ b/always-on-source/AlwaysOnDisplay.mc @@ -75,7 +75,6 @@ class AlwaysOnDisplay extends Ui.Drawable { // TIME. var clockTime = Sys.getClockTime(); var formattedTime = App.getApp().getFormattedTime(clockTime.hour, clockTime.min); - formattedTime[:amPm] = formattedTime[:amPm].toUpper(); // Change vertical offset every minute. var burnInYOffset = mBurnInYOffsets[clockTime.min % mBurnInYOffsets.size()] + (clockTime.min - 30); diff --git a/source/CrystalApp.mc b/source/CrystalApp.mc index 20d3a0a4..42e8cb49 100644 --- a/source/CrystalApp.mc +++ b/source/CrystalApp.mc @@ -238,14 +238,14 @@ class CrystalApp extends App.AppBase { if (hour > 12) { hour = hour - 12; } - amPm = "p"; + amPm = "P"; } else { // #27 Ensure midnight is shown as 12, not 00. if (hour == 0) { hour = 12; } - amPm = "a"; + amPm = "A"; } } diff --git a/source/ThickThinTime.mc b/source/ThickThinTime.mc index c8f3d65f..cb00a626 100644 --- a/source/ThickThinTime.mc +++ b/source/ThickThinTime.mc @@ -61,7 +61,6 @@ class ThickThinTime extends Ui.Drawable { function drawHoursMinutes(dc) { var clockTime = Sys.getClockTime(); var formattedTime = App.getApp().getFormattedTime(clockTime.hour, clockTime.min); - formattedTime[:amPm] = formattedTime[:amPm].toUpper(); var hours = formattedTime[:hour]; var minutes = formattedTime[:min];