16 lines
386 B
TypeScript
16 lines
386 B
TypeScript
|
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',
|
||
|
})}`
|
||
|
}
|
||
|
|
||
|
export function getRkey({uri}: {uri: string}): string {
|
||
|
return uri.split('/').pop() as string
|
||
|
}
|