QR Print Page: add expiry notice
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user