From 50c05e91d7c12011165b6fa524a957c2d8f8d106 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Mon, 25 May 2026 14:33:50 +0200
Subject: [PATCH] db backup-restore with fk
---
src/pages/Store.tsx | 2 +-
src/pages/billing/SubscriptionTab.tsx | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/pages/Store.tsx b/src/pages/Store.tsx
index e044520..ff3077e 100644
--- a/src/pages/Store.tsx
+++ b/src/pages/Store.tsx
@@ -178,7 +178,7 @@ const StorePage: React.FC = () => {
)}
{subscriptionInfo.status === 'TRIALING' && subscriptionInfo.trialEndsAt && (
- {t('Testphase endet am')}: {new Date(subscriptionInfo.trialEndsAt).toLocaleDateString()}
+ {t('Testphase endet am')}: {new Date(Number(subscriptionInfo.trialEndsAt) * 1000).toLocaleDateString('de-CH', { day: '2-digit', month: '2-digit', year: 'numeric' })}
)}
diff --git a/src/pages/billing/SubscriptionTab.tsx b/src/pages/billing/SubscriptionTab.tsx
index 6e5956d..e3fb3ac 100644
--- a/src/pages/billing/SubscriptionTab.tsx
+++ b/src/pages/billing/SubscriptionTab.tsx
@@ -23,12 +23,16 @@ import { useLanguage } from '../../providers/language/LanguageContext';
const _formatCurrency = (amount: number) =>
new Intl.NumberFormat('de-CH', { style: 'currency', currency: 'CHF' }).format(amount);
-const _formatDate = (iso: string | null | undefined): string => {
- if (!iso) return '—';
+const _formatDate = (value: string | number | null | undefined): string => {
+ if (value == null || value === '') return '—';
try {
- return new Date(iso).toLocaleDateString('de-CH', { day: '2-digit', month: '2-digit', year: 'numeric' });
+ const num = typeof value === 'number' ? value : Number(value);
+ const ms = !isNaN(num) && num < 1e12 ? num * 1000 : num;
+ const d = !isNaN(ms) ? new Date(ms) : new Date(value);
+ if (isNaN(d.getTime())) return String(value);
+ return d.toLocaleDateString('de-CH', { day: '2-digit', month: '2-digit', year: 'numeric' });
} catch {
- return iso;
+ return String(value);
}
};