mirror of https://github.com/ethereum/go-ethereum
add lastModified date (#68)
* add lastModified date * prettier * fix type errors on build Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>pull/26459/head^2
parent
b04fd9206f
commit
d4c57f9174
@ -1,12 +1,13 @@ |
||||
export const getParsedDate = (date: string) => { |
||||
const dateOptions = { |
||||
export const getParsedDate = ( |
||||
date: string | Date, |
||||
dateOptions: Intl.DateTimeFormatOptions = { |
||||
year: 'numeric', |
||||
month: 'long', |
||||
day: 'numeric', |
||||
hour: '2-digit', |
||||
minute: '2-digit', |
||||
timeZone: 'UTC' |
||||
} as const; |
||||
|
||||
} as const |
||||
) => { |
||||
return new Date(date).toLocaleDateString('en', dateOptions); |
||||
}; |
||||
|
Loading…
Reference in new issue