Also show overdue tasks in current view
This commit is contained in:
parent
c841fa03bb
commit
2bff5aa24f
2 changed files with 7 additions and 5 deletions
|
@ -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) ->
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue