Explorar o código

Update dateCompleted and modified when completing task

Adel Qalieh %!s(int64=12) %!d(string=hai) anos
pai
achega
3109a48e1f
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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) ->