Skip to content

Commit bcaf806

Browse files
authored
Fix: Hide last year's presentations (#6)
1 parent 3c020dd commit bcaf806

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/app/dashboard/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { PageRoot } from '@/types/route';
44
import { SideNav, SideNavLayout } from '@/ui/side-nav';
55

66
export const dynamic = 'force-dynamic';
7+
const ALMOST_A_YEAR = 200 * 24 * 60 * 60 * 1000;
78

89
export default async function Layout({
910
children,
@@ -12,6 +13,7 @@ export default async function Layout({
1213
}) {
1314
const presentations = await prisma.presentation.findMany({
1415
orderBy: [{ start: 'asc' }, { room: 'asc' }],
16+
where: { start: { gte: new Date(Date.now() - ALMOST_A_YEAR) } },
1517
});
1618
return (
1719
<WithSession>

0 commit comments

Comments
 (0)