From 2100bdf90ecaa5455e5cc4a79777a40f55662e00 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sat, 31 Jan 2026 20:34:36 +0100 Subject: [PATCH] fix: enhance subscription renewal date display in OrganizationSettings component; ensure proper handling of invalid date values --- components/settings/OrganizationSettings.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/settings/OrganizationSettings.tsx b/components/settings/OrganizationSettings.tsx index 62bd97f..bd221ca 100644 --- a/components/settings/OrganizationSettings.tsx +++ b/components/settings/OrganizationSettings.tsx @@ -594,9 +594,12 @@ export default function OrganizationSettings() {
Renews On
- {subscription.current_period_end - ? new Date(subscription.current_period_end).toLocaleDateString() - : '—'} + {(() => { + const raw = subscription.current_period_end + const d = raw ? new Date(raw as string) : null + const ts = d ? d.getTime() : NaN + return raw && !Number.isNaN(ts) && ts !== 0 ? (d as Date).toLocaleDateString() : '—' + })()}