Przeglądaj źródła

[fixed] daystart not accounting for 2016 being a leap-year

Sicaa 4 lat temu
rodzic
commit
ff37c2cf4d
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      locations/daystart.qsrc

+ 2 - 2
locations/daystart.qsrc

@@ -24,8 +24,8 @@ if daystart_start = 0:
 end
 
 daystart = (year - 2016) * 365
-!!Leap year correction, offset not needed as 2016 is a leap year and start date is after February
-daystart += (year - 2016) / 4
+!!Leap year correction (+1 for 2016 which has 366 days, and +1 for every 4th year after)
+if year > 2016: daystart += 1 + (year - 2016) / 4
 
 i=1
 :daystart