Frontend created and rewritten a few times, with some backend fixes #1
|
@ -42,13 +42,14 @@ export function formatUnixDate(t: number) {
|
||||||
return formatter.format(Math.round(diff / 86400000), 'day')
|
return formatter.format(Math.round(diff / 86400000), 'day')
|
||||||
}
|
}
|
||||||
|
|
||||||
let d = date.toLocaleDateString(undefined, {
|
let d = date.toLocaleDateString('en-ie', {
|
||||||
weekday: 'short',
|
weekday: 'short',
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
}).replace("Sept", "Sep").replaceAll(',', '')
|
}).replace("Sept", "Sep")
|
||||||
d = (d.length === 15 ? d : d.replace(' ', ' \u2007')).replaceAll(' ', '\u202F').replace('\u202F', '\u00A0')
|
if (d.length === 14) d = d.replace(' ', '\u202F\u2007') // dom < 10 alignment (thin and figure spaces)
|
||||||
|
d = d.replaceAll(' ', '\u202F').replace('\u202F', '\u00A0') // nobr spaces, thin w/ date but not weekday
|
||||||
d = d.slice(0, -4) + d.slice(-2) // Two digit year is enough
|
d = d.slice(0, -4) + d.slice(-2) // Two digit year is enough
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user