Skip to content

Commit

Permalink
fix: set expiry date to Jan 1st of following year
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokamoto committed Feb 17, 2024
1 parent ca3a505 commit 1d74535
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/(account)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 1d74535

Please sign in to comment.