Bug 624211 - Current Tasks filter should only show completed tasks if completed today r=philipp ui-r=richard.marti
authorMatthew Mecca <matthew.mecca@gmail.com>
Thu, 14 Jul 2011 01:31:13 +0200
changeset 7988 0052b843faf65a5eb3cac7a612cc966003ee4019
parent 7987 fc9ceb0f742efd537f80e42c7f04ad06e13842b0
child 7989 5ac6e80b1116159099c359bfd63ff707fcc363ba
push id50
push usermozilla@kewis.ch
push dateTue, 19 Jul 2011 20:04:29 +0000
treeherdercomm-beta@aee08b4d6cf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp, richard.marti
bugs624211
Bug 624211 - Current Tasks filter should only show completed tasks if completed today r=philipp ui-r=richard.marti
calendar/base/src/calFilter.js
--- a/calendar/base/src/calFilter.js
+++ b/calendar/base/src/calFilter.js
@@ -101,16 +101,26 @@ calFilter.prototype = {
         open: function cF_filterCompleted(item) {
             return (percentCompleted(item) < 100);
         },
         completed: function cF_filterCompleted(item) {
             return (percentCompleted(item) >= 100);
         },
         repeating: function cF_filterRepeating(item) {
             return (item.recurrenceInfo != null);
+        },
+        throughcurrent: function cF_filterThroughCurrent(item) {
+            if (!item.completedDate) {
+                return true;
+            }
+            // filter out tasks completed earlier than today
+            let today = cal.now();
+            today.isDate = true;
+
+            return (today.compare(item.completedDate) <= 0);
         }
     },
 
     get startDate() {
         return this.mStartDate;
     },
 
     set startDate(aStartDate) {