Initial commit
Made-with: Cursor
This commit is contained in:
18
frontend/src/lib/pragueDate.ts
Normal file
18
frontend/src/lib/pragueDate.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/** Kalendářní den YYYY-MM-DD v časové zóně Europe/Prague. */
|
||||
export function pragueCalendarDay(d = new Date()): string {
|
||||
return new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Europe/Prague',
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
}).format(d)
|
||||
}
|
||||
|
||||
export function instantPragueDay(iso: string): string {
|
||||
return new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Europe/Prague',
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
}).format(new Date(iso))
|
||||
}
|
||||
Reference in New Issue
Block a user