Parcourir la source

Update dateCompleted and modified when completing task

Adel Qalieh il y a 12 ans
Parent
commit
3109a48e1f
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      astroid-web.coffee

+ 5 - 1
astroid-web.coffee

@@ -8,8 +8,12 @@ if Meteor.isClient
 
   Template.todos.events
     'click a.completeBox': (e) ->
+      now = moment()
       Tasks.update this._id,
-        $set: completed: not @completed
+        $set:
+          completed: not @completed
+          dateCompleted: now
+          modified: now
 
   Template.newTaskForm.events
     'submit #new-task, click #addTaskButton': (e) ->