Skip to content

Commit

Permalink
account for DST by offsetting difference in utc_offset (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyx-billy committed Dec 4, 2017
1 parent 133ae9f commit 647f980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/submission.rb
Expand Up @@ -523,8 +523,8 @@ def days_late!
# check if no due at (due to infinite extension)
return 0 unless aud.due_at

# how late is the submission?
late_by = created_at - aud.due_at
# how late is the submission? (account for DST by offsetting difference in utc_offset)
late_by = created_at - aud.due_at + (created_at.utc_offset - aud.due_at.utc_offset);
return 0 if late_by <= 0

# if you're 2.5 days late, you're 3 days late
Expand Down

0 comments on commit 647f980

Please sign in to comment.