Buchungskalender: Portal-Tests mit fester Uhr

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Opus 5.5 committed 2026-10-07 14:16:24 +00:00
1 parent 8c8fa05591
commit 10fe9a2ae0
3 files changed
+10 -3

No files matched your search

-1
View File
@@ -178,7 +178,6 @@ export async function render(panel, ctx) {
if (typeof link === 'string' && link) {
const meldung = h('p', { class: 'sh-hinweis', role: 'status' })
box.append(
h('p', null, 'Falls die Mail nicht ankommt, kannst du den Link selbst schicken:'),
h('input', { type: 'text', readonly: true, value: link, 'aria-label': 'Buchungslink', 'data-link': true }),
h('button', {
type: 'button', class: 'kb-btn-outline', 'data-aktion': 'link-kopieren',
+4 -1
View File
@@ -9,7 +9,10 @@ export const tagMs = (tag) => { const [j, m, t] = String(tag).split('-').map(Num
export const msTag = (ms) => new Date(ms).toISOString().slice(0, 10)
export const plusTage = (tag, n) => msTag(tagMs(tag) + n * 86400000)
/** Heute als Berlin-Datum. */
export const heuteBerlin = () => new Date().toLocaleDateString('sv-SE', { timeZone: 'Europe/Berlin' })
let jetzt = () => new Date()
/** Uhr der Portal-Reiter austauschen (nur fuer Tests); ohne Argument zurueck auf die echte Uhr. */
export const setzeUhrFuerTests = (fn) => { jetzt = fn || (() => new Date()) }
export const heuteBerlin = () => jetzt().toLocaleDateString('sv-SE', { timeZone: 'Europe/Berlin' })
/** '2026-11-12' ⇒ '12.11.2026'. */
export const tagText = (tag) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(tag || ''); return m ? `${m[3]}.${m[2]}.${m[1]}` : '' }