Skip to content

Commit

Permalink
Merge pull request #8 from KristijanEftimov/main
Browse files Browse the repository at this point in the history
When calculating the forecasted costs, the end date must be after the…
  • Loading branch information
kristijaneftimovpcg authored Sep 30, 2024
2 parents 183290e + aa92184 commit 5482fa3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def get_forecast_dates():
next_month = start_date.replace(day=28) + datetime.timedelta(days=4) # Move to the next month
end_date = next_month.replace(day=1) - datetime.timedelta(days=1) # Last day of the current month

if start_date == end_date:
end_date = end_date + datetime.timedelta(days=1)

return start_date, end_date

#Function to get the forecast cost for the current month
Expand Down

0 comments on commit 5482fa3

Please sign in to comment.