Fix DST timezone change (move from DST to normal jump) (#56)

This commit is contained in:
Stan Triepels
2022-12-22 03:02:53 +01:00
committed by GitHub
parent 08baaab125
commit b66dfbd3af
2 changed files with 48 additions and 7 deletions
+2 -7
View File
@@ -255,13 +255,8 @@ class Schedule(models.Model):
# based on DST active or not
extra_diff = (new_next_run - current_next_run) - add
# if we have one positive hour difference, then subtract it, so we are even
# and vice versa. In most cases, this will be 0, as there won't be a
# timezone diff
if extra_diff > timedelta(hours=0):
next_run -= extra_diff
else:
next_run += extra_diff
# subtract difference
next_run -= extra_diff
return next_run