db backup-restore with fk
All checks were successful
Deploy Nyla Frontend to Production / deploy (push) Successful in 44s
All checks were successful
Deploy Nyla Frontend to Production / deploy (push) Successful in 44s
This commit is contained in:
parent
036e6a38db
commit
50c05e91d7
2 changed files with 9 additions and 5 deletions
|
|
@ -178,7 +178,7 @@ const StorePage: React.FC = () => {
|
|||
)}
|
||||
{subscriptionInfo.status === 'TRIALING' && subscriptionInfo.trialEndsAt && (
|
||||
<span className={styles.bannerSeparator}>
|
||||
{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' })}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue