Merge pull request #1371 from nealterrell/patch-1
Include the 100/400 year check for leap years in MagTag Year Progress demo
This commit is contained in:
commit
e32b99320a
1 changed files with 1 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ import rtc
|
|||
|
||||
def days_in_year(date_obj):
|
||||
# check for leap year
|
||||
if date_obj.tm_year % 4 == 0:
|
||||
if (date_obj.tm_year % 100 != 0 or date_obj.tm_year % 400 == 0) and date_obj.tm_year % 4 == 0:
|
||||
return 366
|
||||
return 365
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue