From fc1de92806b9badddce38131cc72d198d1174b46 Mon Sep 17 00:00:00 2001 From: daeseong9388 Date: Thu, 24 Nov 2022 17:46:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20RTL=20=EA=B0=80=EC=A0=B8=EC=98=A4?= =?UTF-8?q?=EA=B8=B0=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC=ED=98=84=20?= =?UTF-8?q?resolve=20#71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/core/todo/todoList.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/src/core/todo/todoList.ts b/client/src/core/todo/todoList.ts index ad535e2..f897f5c 100644 --- a/client/src/core/todo/todoList.ts +++ b/client/src/core/todo/todoList.ts @@ -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[] {