mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 23:28:12 +08:00
Fix DST timezone change (move from DST to normal jump) (#56)
This commit is contained in:
+2
-7
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user