[APP-611] Add nice date to expanded post view (#567)
* Add nice date to expanded post view * Fix styles
This commit is contained in:
parent
6f1c4ec9a9
commit
2eb0d8c095
3 changed files with 20 additions and 2 deletions
|
@ -27,3 +27,15 @@ export function ago(date: number | string | Date): string {
|
|||
return new Date(ts).toLocaleDateString()
|
||||
}
|
||||
}
|
||||
|
||||
export function niceDate(date: number | string | Date) {
|
||||
const d = new Date(date)
|
||||
return `${d.toLocaleDateString('en-us', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})} at ${d.toLocaleTimeString(undefined, {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
})}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue