mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
Add habit history (only implemented for up + down habits, need to
implement for only-up or only-down somehow)
This commit is contained in:
parent
39a66facf5
commit
8d9fb109a4
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue