Skip to content

Commit

Permalink
fix time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-mmyliu authored and nyiyui committed Dec 13, 2022
1 parent 28ea9b1 commit c9122e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scavenger2022/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
d = (end - Date.now()) / 1000
start = false
}
const hour = Math.round(d / 3600 % 24) - 1
const minute = Math.round(d / 60 % 60)
const second = Math.round(d % 60)
const day = Math.round(d % (3600*24) / (3600*24))
const day = Math.floor(d / 86400)
const hour = Math.floor((d - day * 86400) / 3600)
const minute = Math.floor((d - day * 86400 - hour * 3600) / 60)
const second = d % 60
let s = ''
if (day == 1) s += '1 day, '
else if (day == 0);
Expand Down

0 comments on commit c9122e3

Please sign in to comment.