mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
moment changed .sod() to .startOf('day')
This commit is contained in:
parent
dc1639ceb4
commit
842d3183b2
2 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ moment = require('moment')
|
|||
|
||||
# Absolute diff between two dates, based on 12am for both days
|
||||
module.exports.daysBetween = (a, b) ->
|
||||
Math.abs(moment(a).sod().diff(moment(b).sod(), 'days'))
|
||||
Math.abs(moment(a).startOf('day').diff(moment(b).startOf('day'), 'days'))
|
||||
|
||||
module.exports.dayMapping = dayMapping = {0:'su',1:'m',2:'t',3:'w',4:'th',5:'f',6:'s',7:'su'}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ module.exports.deleteStaleAccounts = ->
|
|||
return unless user? #why does this happen sometimes?
|
||||
if !!user.lastCron # for now ignore missing crons, still looking into why this is happening
|
||||
lastCron = new Date(user.lastCron)
|
||||
diff = Math.abs(moment(today).sod().diff(moment(lastCron).sod(), "days"))
|
||||
diff = Math.abs(moment(today).startOf('day').diff(moment(lastCron).startOf('day'), "days"))
|
||||
if diff > 10
|
||||
removeAccount(collection, user._id)
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue