mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 19:50:37 +00:00
add shouldCron so we can test before running cron
This commit is contained in:
parent
7805a2ba26
commit
9882e70026
1 changed files with 6 additions and 0 deletions
|
|
@ -308,6 +308,12 @@ updateStats = (user, newStats, paths) ->
|
||||||
gp = 0.0 if (!gp? or gp < 0)
|
gp = 0.0 if (!gp? or gp < 0)
|
||||||
user.stats.gp = newStats.gp
|
user.stats.gp = newStats.gp
|
||||||
|
|
||||||
|
obj.shouldCron = (user) ->
|
||||||
|
today = +new Date
|
||||||
|
lastCron = user.lastCron
|
||||||
|
return true if !lastCron? or lastCron is 'new' or moment(lastCron).isAfter(today)
|
||||||
|
return daysMissed = helpers.daysBetween(user.lastCron, today, user.preferences?.dayStart) > 0
|
||||||
|
|
||||||
###
|
###
|
||||||
At end of day, add value to all incomplete Daily & Todo tasks (further incentive)
|
At end of day, add value to all incomplete Daily & Todo tasks (further incentive)
|
||||||
For incomplete Dailys, deduct experience
|
For incomplete Dailys, deduct experience
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue