Skip to content

Commit

Permalink
fix expression
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Oct 9, 2024
1 parent 1720551 commit 7aad9d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions antarest/study/storage/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ def get_start_date(
starting_day_index = DAY_NAMES.index(starting_day.title())
target_year = 2018
while True:
year_to_check_for_leap = target_year + (starting_month_index != 1)
if leapyear == calendar.isleap(year_to_check_for_leap):
first_day = datetime(year_to_check_for_leap, 1, 1)
if leapyear == calendar.isleap(target_year + (starting_month_index > 2)):
first_day = datetime(target_year + (starting_month_index != 1), 1, 1)
if first_day.weekday() == starting_day_index:
break
target_year += 1
Expand Down

0 comments on commit 7aad9d5

Please sign in to comment.