From 616031b7ca0f199010f7442163b0ac3071e2bd93 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Fri, 24 Feb 2023 10:20:15 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20created=20col?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/pages/documents.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/documents.tsx b/apps/web/pages/documents.tsx index 92dd7c782..f3fb52239 100644 --- a/apps/web/pages/documents.tsx +++ b/apps/web/pages/documents.tsx @@ -18,6 +18,7 @@ import { DocumentStatus } from "@prisma/client"; import { Tooltip as ReactTooltip } from "react-tooltip"; import { Button, IconButton, SelectBox } from "@documenso/ui"; import { NextPageContext } from "next"; +import prisma from "@documenso/prisma"; const DocumentsPage: NextPageWithLayout = (props: any) => { const router = useRouter(); @@ -35,7 +36,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => { { label: "Last 7 days", value: 7 }, { label: "Last 30 days", value: 30 }, { label: "Last 3 months", value: 90 }, - { label: "Last 12 months", value: 66 }, + { label: "Last 12 months", value: 366 }, ]; const [selectedStatusFilter, setSelectedStatusFilter] = useState( @@ -98,6 +99,8 @@ const DocumentsPage: NextPageWithLayout = (props: any) => { (today.getTime() - documentDate.getTime()) / millisecondsInDay ); + console.log(diffInDays); + // Check if the difference is letss or equal to lastXDays return diffInDays <= lastXDays; } @@ -196,6 +199,12 @@ const DocumentsPage: NextPageWithLayout = (props: any) => { > Status + + Created + {

+ + {new Date(document.created).toLocaleDateString()} +