From 1d745354131bc67eb142230bfa28d5add09d97aa Mon Sep 17 00:00:00 2001 From: Ray <22254748+rayokamoto@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:07:37 +1030 Subject: [PATCH] fix: set expiry date to Jan 1st of following year --- src/app/(account)/settings/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/(account)/settings/page.tsx b/src/app/(account)/settings/page.tsx index 872320c1..1eecb0eb 100644 --- a/src/app/(account)/settings/page.tsx +++ b/src/app/(account)/settings/page.tsx @@ -37,8 +37,9 @@ const verifyMembershipPayment = async (clerkId: string) => { return { paid: false as const }; } + // Set expiry date to be the January 1st of the following year const now = new Date(); - const expiryDate = new Date(now.setFullYear(now.getFullYear() + 1)); + const expiryDate = new Date(`${now.getFullYear() + 1}-01-01`); await db .update(memberTable) .set({ membershipExpiresAt: expiryDate })