lastCron bug fix (still buggy though)
This commit is contained in:
@@ -100,14 +100,12 @@ get '/', (page, model) ->
|
|||||||
#TODO: Implement this for cron
|
#TODO: Implement this for cron
|
||||||
poormanscron = (model) ->
|
poormanscron = (model) ->
|
||||||
lastCron = model.get('_user.lastCron')
|
lastCron = model.get('_user.lastCron')
|
||||||
if lastCron
|
lastCron = if lastCron then (new Date(lastCron)) else new Date()
|
||||||
DAY = 1000 * 60 * 60 * 24
|
DAY = 1000 * 60 * 60 * 24
|
||||||
today = new Date()
|
today = new Date()
|
||||||
days_passed = Math.round((today.getTime() - lastCron.getTime()) / DAY)
|
days_passed = Math.round((today.getTime() - lastCron.getTime()) / DAY)
|
||||||
if days_passed > 0
|
if days_passed > 0
|
||||||
endOfDayTally(model) for[]in length:days_passed
|
endOfDayTally(model) for[]in length:days_passed
|
||||||
lastCron = new Date()
|
|
||||||
else
|
|
||||||
lastCron = new Date()
|
lastCron = new Date()
|
||||||
model.set('_user.lastCron', lastCron)
|
model.set('_user.lastCron', lastCron)
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a x-bind=click:toggleTodosChart><i class=icon-signal></i></a>
|
{#if _user.history.todos}
|
||||||
<div id="todos-chart" style="display:none;"></div>
|
<a x-bind=click:toggleTodosChart><i class=icon-signal></i></a>
|
||||||
|
<div id="todos-chart" style="display:none;"></div>
|
||||||
|
{/}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span3 well">
|
<div class="span3 well">
|
||||||
|
|||||||
Reference in New Issue
Block a user