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 8339 f8fd586b28152119f9d1214f8b835b477657a4b9
parent 8338 936873f0612db38cb2c577fb26ff15f9a8c32b95
child 8340 6feddf7992baddc59d1d0281ff7ece6085def671
push idunknown
push userunknown
push dateunknown
reviewersphilipp, richard
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) {