Buchungskalender: Portal-Tests mit fester Uhr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c8fa05591
commit
10fe9a2ae0
3 files changed
+10
-3
No files matched your search
@@ -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]}` : '' }
|
||||
|
||||
|
||||
Reference in new issue
Block a user