mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
use underscore's _().times for daysPassed
This commit is contained in:
parent
97478120ff
commit
2444676cc4
1 changed files with 4 additions and 3 deletions
|
|
@ -130,9 +130,10 @@ ready (model) ->
|
|||
lastCron = if lastCron then (new Date(lastCron)) else new Date()
|
||||
DAY = 1000 * 60 * 60 * 24
|
||||
today = new Date()
|
||||
days_passed = Math.round((today.getTime() - lastCron.getTime()) / DAY)
|
||||
if days_passed > 0
|
||||
endOfDayTally() for[]in length:days_passed
|
||||
daysPassed = Math.round((today.getTime() - lastCron.getTime()) / DAY)
|
||||
if daysPassed > 0
|
||||
_(daysPassed).times ->
|
||||
endOfDayTally()
|
||||
lastCron = new Date()
|
||||
model.set('_user.lastCron', lastCron)
|
||||
poormanscron()
|
||||
|
|
|
|||
Loading…
Reference in a new issue