Add habit history (only implemented for up + down habits, need to

implement for only-up or only-down somehow)
This commit is contained in:
Tyler Renelle 2012-07-06 16:30:18 -04:00
parent 39a66facf5
commit 8d9fb109a4

View file

@ -336,6 +336,9 @@ ready (model) ->
if task.get('type') != 'habit'
completed = true if direction=="up"
completed = false if direction=="down"
else
# Add habit value to habit-history (if different)
task.push 'history', { date: new Date(), value: value } if task.get('value') != value
task.set('value', value)
task.set('completed', completed)