]> git.earman.xyz Git - sensor-watch.git/commitdiff
Revert "Fix for wrong date being shown on sunrise/sunset complication."
authorvoloved <36523934+voloved@users.noreply.github.com>
Mon, 1 Dec 2025 13:19:05 +0000 (08:19 -0500)
committerGitHub <noreply@github.com>
Mon, 1 Dec 2025 13:19:05 +0000 (08:19 -0500)
watch-faces/complication/sunrise_sunset_face.c

index d19dcb61be3d8b70d62ef414c5428741155678e9..7dcb33506229508660b3d0d494ba44eec47dee14 100644 (file)
@@ -84,7 +84,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
     watch_date_time_t date_time = movement_get_local_date_time(); // the current local date / time
     watch_date_time_t utc_now = watch_utility_date_time_convert_zone(date_time, movement_get_current_timezone_offset(), 0); // the current date / time in UTC
     watch_date_time_t scratch_time; // scratchpad, contains different values at different times
-    scratch_time.reg = date_time.reg;
+    scratch_time.reg = utc_now.reg;
 
     // Weird quirky unsigned things were happening when I tried to cast these directly to doubles below.
     // it looks redundant, but extracting them to local int16's seemed to fix it.
@@ -200,7 +200,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) {
         }
 
         // it's after sunset. we need to display sunrise/sunset for tomorrow.
-        uint32_t timestamp = watch_utility_date_time_to_unix_time(date_time, 0);
+        uint32_t timestamp = watch_utility_date_time_to_unix_time(utc_now, 0);
         timestamp += 86400;
         scratch_time = watch_utility_date_time_from_unix_time(timestamp, 0);
     }