11 lines
404 B
TypeScript
11 lines
404 B
TypeScript
export function formatDate(iso: string): string {
|
|
return new Date(`${iso}T00:00:00`).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' })
|
|
}
|
|
|
|
export function todayIso(): string {
|
|
const today = new Date()
|
|
const month = String(today.getMonth() + 1).padStart(2, '0')
|
|
const day = String(today.getDate()).padStart(2, '0')
|
|
return `${today.getFullYear()}-${month}-${day}`
|
|
}
|