InfiniTime.git

commit 9e9e348a617da2629ae9ff6ff5686586690e9cfb

Author: Adam <git@apiote.xyz>

fix calculating world calendar date in leap year

 src/displayapp/screens/WatchFaceMine.cpp | 12 +++++-------


diff --git a/src/displayapp/screens/WatchFaceMine.cpp b/src/displayapp/screens/WatchFaceMine.cpp
index 8e038b408783feeb55edb5d96c7de3e2bada867e..b0b6cf5ce318ba8916d83e2f13f37eb66ef8ca65 100644
--- a/src/displayapp/screens/WatchFaceMine.cpp
+++ b/src/displayapp/screens/WatchFaceMine.cpp
@@ -471,7 +471,10 @@   ordinal -= 1;
   if (ordinal == 196 and isLeap) {
     return "LD";
   }
-  if (ordinal == 364 or (ordinal == 365 and isLeap)) {
+  if (ordinal >196 and isLeap) {
+    ordinal -= 1;
+  }
+  if (ordinal == 364) {
     return "OY";
   }
 
@@ -490,14 +493,9 @@                            'v', 'v', 'v',
                            's',
                            'e', 'e', 'e',
                            'u', 'u', 'u'};
-  char const *weekdays[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
-
-  if (isLeap) {
-    sun -= 1;
-  }
 
   char buf[10];
-  sprintf(buf, "%s\n%s%c %d%d", weekdays[ordinal%7], moons1[moon], moons2[moon], week, sun);
+  sprintf(buf, "\n%s%c %d%d", moons1[moon], moons2[moon], week, sun);
 
   return std::string(buf);
 }