Skip to content

Commit

Permalink
feat: TodoList의 메타데이터를 반환하는 TodoList.summary 메서드 구현(일부)
Browse files Browse the repository at this point in the history
  • Loading branch information
n-ryu committed Nov 28, 2022
1 parent 576bc57 commit ee4a939
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion client/src/core/todo/todoList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,21 @@ export class TodoList {
}

getSummary(): any {
return '';
return {
numberOfImminenceTodos: this.todoList
.filter((el) => el.state === 'READY')
.filter((el) => isEqualDate(el.until, new Date())).length,
numberOfDistantTodos: this.todoList
.filter((el) => el.state === 'READY')
.filter((el) => !isEqualDate(el.until, new Date())).length,
numberOfReadyStateTodos: this.todoList.filter((el) => el.state === 'READY').length,
numberOfWaitStateTodos: this.todoList.filter((el) => el.state === 'WAIT').length,
numberOfTotalTodos: this.todoList.length,
numberOfRemainingTodos: -1,
numberOfPostpones: -1,
TotalElapsedTime: -1,
numberOfTodayDoneTodos: -1,
};
}

private checkPrev(todo: Todo): boolean {
Expand Down

0 comments on commit ee4a939

Please sign in to comment.