created col

This commit is contained in:
Timur Ercan
2023-02-24 10:20:15 +01:00
parent 6518d33f64
commit 616031b7ca

View File

@ -18,6 +18,7 @@ import { DocumentStatus } from "@prisma/client";
import { Tooltip as ReactTooltip } from "react-tooltip"; import { Tooltip as ReactTooltip } from "react-tooltip";
import { Button, IconButton, SelectBox } from "@documenso/ui"; import { Button, IconButton, SelectBox } from "@documenso/ui";
import { NextPageContext } from "next"; import { NextPageContext } from "next";
import prisma from "@documenso/prisma";
const DocumentsPage: NextPageWithLayout = (props: any) => { const DocumentsPage: NextPageWithLayout = (props: any) => {
const router = useRouter(); const router = useRouter();
@ -35,7 +36,7 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
{ label: "Last 7 days", value: 7 }, { label: "Last 7 days", value: 7 },
{ label: "Last 30 days", value: 30 }, { label: "Last 30 days", value: 30 },
{ label: "Last 3 months", value: 90 }, { label: "Last 3 months", value: 90 },
{ label: "Last 12 months", value: 66 }, { label: "Last 12 months", value: 366 },
]; ];
const [selectedStatusFilter, setSelectedStatusFilter] = useState( const [selectedStatusFilter, setSelectedStatusFilter] = useState(
@ -98,6 +99,8 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
(today.getTime() - documentDate.getTime()) / millisecondsInDay (today.getTime() - documentDate.getTime()) / millisecondsInDay
); );
console.log(diffInDays);
// Check if the difference is letss or equal to lastXDays // Check if the difference is letss or equal to lastXDays
return diffInDays <= lastXDays; return diffInDays <= lastXDays;
} }
@ -196,6 +199,12 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
> >
Status Status
</th> </th>
<th
scope="col"
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900"
>
Created
</th>
<th <th
scope="col" scope="col"
className="relative py-3.5 pl-3 pr-4 sm:pr-6" className="relative py-3.5 pl-3 pr-4 sm:pr-6"
@ -303,6 +312,9 @@ const DocumentsPage: NextPageWithLayout = (props: any) => {
</small> </small>
</p> </p>
</td> </td>
<td className="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
{new Date(document.created).toLocaleDateString()}
</td>
<td className="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6"> <td className="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
<div> <div>
<IconButton <IconButton