diff --git a/app/[locale]/subscription/page.tsx b/app/[locale]/subscription/page.tsx
index 0c89e78..a27d9d4 100644
--- a/app/[locale]/subscription/page.tsx
+++ b/app/[locale]/subscription/page.tsx
@@ -164,7 +164,12 @@ export default function SubscriptionPage() {
}
const formatResetDate = (dateString: string | null) => {
- if (!dateString) return ''
+ if (!dateString) {
+ // If no reset date set, calculate 1 month from now
+ const nextMonth = new Date()
+ nextMonth.setMonth(nextMonth.getMonth() + 1)
+ return nextMonth.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
+ }
const date = new Date(dateString)
return date.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
}
diff --git a/components/subscription/upgrade-modal.tsx b/components/subscription/upgrade-modal.tsx
index 2637661..dd54f2b 100644
--- a/components/subscription/upgrade-modal.tsx
+++ b/components/subscription/upgrade-modal.tsx
@@ -37,7 +37,12 @@ export default function UpgradeModal({ open, onClose, limitData }: UpgradeModalP
const usagePercentage = limitData ? ((limitData.limit - limitData.remaining) / limitData.limit) * 100 : 100
const formatResetDate = (dateString: string | null) => {
- if (!dateString) return ''
+ if (!dateString) {
+ // If no reset date set, calculate 1 month from now
+ const nextMonth = new Date()
+ nextMonth.setMonth(nextMonth.getMonth() + 1)
+ return nextMonth.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
+ }
const date = new Date(dateString)
return date.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
}
@@ -94,11 +99,9 @@ export default function UpgradeModal({ open, onClose, limitData }: UpgradeModalP
}
}}
/>
- {limitData.resetDate && (
-
- {t('resetsOn', { date: formatResetDate(limitData.resetDate) })}
-
- )}
+
+ {t('resetsOn', { date: formatResetDate(limitData.resetDate) })}
+
)}
diff --git a/components/subscription/usage-display.tsx b/components/subscription/usage-display.tsx
index fbc7d53..d577000 100644
--- a/components/subscription/usage-display.tsx
+++ b/components/subscription/usage-display.tsx
@@ -79,7 +79,12 @@ export default function UsageDisplay({ compact = false, showUpgradeButton = true
}
const formatResetDate = (dateString: string | null) => {
- if (!dateString) return ''
+ if (!dateString) {
+ // If no reset date set, calculate 1 month from now
+ const nextMonth = new Date()
+ nextMonth.setMonth(nextMonth.getMonth() + 1)
+ return nextMonth.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
+ }
const date = new Date(dateString)
return date.toLocaleDateString(locale, { year: 'numeric', month: 'long', day: 'numeric' })
}