QR Print Page: add expiry notice

This commit is contained in:
Codex Agent
2026-01-06 08:35:48 +01:00
parent 88012c35bd
commit 34eb2b94b3
5 changed files with 142 additions and 1 deletions

View File

@@ -132,6 +132,13 @@ export default function MobileQrPrintPage() {
{qrUrl}
</Text>
) : null}
<Text fontSize="$xs" color={muted} marginTop="$1">
{selectedInvite?.expires_at
? t('events.qr.expiresAt', 'Valid until {{date}}', {
date: formatExpiry(selectedInvite.expires_at),
})
: t('events.qr.noExpiry', 'No expiry configured')}
</Text>
<Text fontSize="$xs" color={muted}>
{t('events.qr.description', 'Scan to access the event guest app.')}
</Text>
@@ -238,6 +245,12 @@ export default function MobileQrPrintPage() {
);
}
function formatExpiry(value: string): string {
const date = new Date(value);
if (Number.isNaN(date.getTime())) return value;
return date.toLocaleString(undefined, { day: '2-digit', month: 'short', year: 'numeric', hour: '2-digit', minute: '2-digit' });
}
function FormatSelection({
layouts,
selectedFormat,