Skip to content

Commit

Permalink
[master]: Consider leap year (#430)
Browse files Browse the repository at this point in the history
* [master]: Consider leap year

* Update Get_Data.py

---------

Co-authored-by: Jingchang Hong <[email protected]>
  • Loading branch information
ear361 and Jingchang Hong authored Apr 24, 2024
1 parent 71f49b9 commit a76f74d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Process-Data/Get_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@
continue
if month1 in [4, 6, 9, 11] and day1 > 30:
continue
if month1 == 2 and day1 > 28:
continue
if month1 == 2:
if (end_year_pointer % 4 == 0 and end_year_pointer % 100 != 0) or end_year_pointer % 400 == 0:
if day1 > 29:
continue
elif day1 > 28:
continue
if end_year_pointer == datetime.now().year:
if month1 == datetime.now().month and day1 > datetime.now().day:
continue
Expand Down

0 comments on commit a76f74d

Please sign in to comment.