Skip to content

Commit

Permalink
feat: RTL 가져오기 메서드 구현 resolve #71
Browse files Browse the repository at this point in the history
  • Loading branch information
daeseong9388 committed Nov 24, 2022
1 parent 5a4fddd commit fc1de92
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions client/src/core/todo/todoList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,25 @@ class Todo {
static compare(a: Todo, b: Todo): number {
return 1;
}

clone(): Todo {
return {
...this,
from: new Date(this.from),
until: new Date(this.until),
lastPostponed: new Date(this.lastPostponed),
};
}
}

export class TodoList {
todoList: Todo[];
private readonly todoList: Todo[];
constructor() {
this.todoList = [];
}

getRTL(): Todo[] {
return [];
return this.todoList.filter((el) => el.state === 'READY').map((el) => el.clone());
}

getWTL(): Todo[] {
Expand Down

0 comments on commit fc1de92

Please sign in to comment.