Skip to content

Commit

Permalink
Fix date calculation based on yearly period
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcclure committed Apr 16, 2023
1 parent c4611c8 commit 8358c7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/chore_helper/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,9 @@ def _find_candidate_date(self, day1: date) -> date | None:
difference = abs(candidate_date.year - start_date.year)
if difference > 0:
remainder = difference % self._period
if remainder != 0:
if remainder > 0:
candidate_date = date(
candidate_date.year + (self._period - remainder),
int(candidate_date.year + (self._period - remainder)),
candidate_date.month,
candidate_date.day,
)
Expand Down

0 comments on commit 8358c7d

Please sign in to comment.