diff --git a/js/app/services/models/tasksmodel.coffee b/js/app/services/models/tasksmodel.coffee index d90052c3..f2a5425a 100644 --- a/js/app/services/models/tasksmodel.coffee +++ b/js/app/services/models/tasksmodel.coffee @@ -120,7 +120,7 @@ angular.module('Tasks').factory 'TasksModel', when 'all' return task.completed == false when 'current' - return (task.completed == false && @current(task.start)) + return (task.completed == false && @current(task.start, task.due)) when 'starred' return (task.completed == false && task.starred == true) when 'today' @@ -180,9 +180,11 @@ angular.module('Tasks').factory 'TasksModel', moment(due, "YYYYMMDDTHHmmss"). diff(moment().startOf('day'), 'days', true) < 7) - current: (start) -> + current: (start, due) -> return (!moment(start, "YYYYMMDDTHHmmss").isValid() || moment(start, "YYYYMMDDTHHmmss"). + diff(moment(), 'days', true) < 0 || + moment(due, "YYYYMMDDTHHmmss"). diff(moment(), 'days', true) < 0) changeCalendarId: (taskID, calendarID) -> diff --git a/js/public/app.js b/js/public/app.js index 4e216040..e33edc57 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -2257,7 +2257,7 @@ case 'all': return task.completed === false; case 'current': - return task.completed === false && this.current(task.start); + return task.completed === false && this.current(task.start, task.due); case 'starred': return task.completed === false && task.starred === true; case 'today': @@ -2349,8 +2349,8 @@ return moment(due, "YYYYMMDDTHHmmss").isValid() && moment(due, "YYYYMMDDTHHmmss").diff(moment().startOf('day'), 'days', true) < 7; }; - TasksModel.prototype.current = function(start) { - return !moment(start, "YYYYMMDDTHHmmss").isValid() || moment(start, "YYYYMMDDTHHmmss").diff(moment(), 'days', true) < 0; + TasksModel.prototype.current = function(start, due) { + return !moment(start, "YYYYMMDDTHHmmss").isValid() || moment(start, "YYYYMMDDTHHmmss").diff(moment(), 'days', true) < 0 || moment(due, "YYYYMMDDTHHmmss").diff(moment(), 'days', true) < 0; }; TasksModel.prototype.changeCalendarId = function(taskID, calendarID) {