mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
use math.floor, not math.round, when computing daysPassed on cron
This commit is contained in:
parent
4c1a04442d
commit
48f26edfb7
2 changed files with 2 additions and 2 deletions
|
|
@ -515,7 +515,7 @@ ready(function(model) {
|
|||
lastCron = lastCron ? new Date(lastCron) : new Date();
|
||||
DAY = 1000 * 60 * 60 * 24;
|
||||
today = new Date();
|
||||
daysPassed = Math.round((today.getTime() - lastCron.getTime()) / DAY);
|
||||
daysPassed = Math.floor((today.getTime() - lastCron.getTime()) / DAY);
|
||||
if (daysPassed > 0) {
|
||||
_(daysPassed).times(function() {
|
||||
return endOfDayTally();
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ ready (model) ->
|
|||
lastCron = if lastCron then (new Date(lastCron)) else new Date()
|
||||
DAY = 1000 * 60 * 60 * 24
|
||||
today = new Date()
|
||||
daysPassed = Math.round((today.getTime() - lastCron.getTime()) / DAY)
|
||||
daysPassed = Math.floor((today.getTime() - lastCron.getTime()) / DAY)
|
||||
if daysPassed > 0
|
||||
_(daysPassed).times ->
|
||||
endOfDayTally()
|
||||
|
|
|
|||
Loading…
Reference in a new issue