Parcourir la source

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

Sicaa il y a 4 ans
Parent
commit
ff37c2cf4d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  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