From 61ce364b071b800308f3255534b1d31a781f3c3b Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Thu, 23 Feb 2023 18:41:55 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20all=20time=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/pages/documents.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/documents.tsx b/apps/web/pages/documents.tsx index e665c8eb7..038c37933 100644 --- a/apps/web/pages/documents.tsx +++ b/apps/web/pages/documents.tsx @@ -30,7 +30,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => { { label: "Completed", value: "COMPLETED" }, ]; const createdFilter = [ - { label: "All Time", value: 0 }, + { label: "All Time", value: -1 }, { label: "Last 7 days", value: 7 }, { label: "Last 30 days", value: 30 }, { label: "Last 3 months", value: 90 }, @@ -87,6 +87,8 @@ const DocumentsPage: NextPageWithLayout = (props: any) => { } function wasXDaysAgoOrLess(documentDate: Date, lastXDays: number): boolean { + if (lastXDays < 0) return true; + const millisecondsInDay = 24 * 60 * 60 * 1000; // Number of milliseconds in a day const today: Date = new Date(); // Today's date