소스 검색

Update dateCompleted and modified when completing task

Adel Qalieh 12 년 전
부모
커밋
3109a48e1f
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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) ->