2022-07-17 21:40:41 +08:00
|
|
|
import siteMetadata from '@/data/siteMetadata'
|
|
|
|
|
2022-10-07 13:55:39 +08:00
|
|
|
const formatDate = (date: string) => {
|
|
|
|
const options: Intl.DateTimeFormatOptions = {
|
2022-07-17 21:40:41 +08:00
|
|
|
year: 'numeric',
|
|
|
|
month: 'long',
|
|
|
|
day: 'numeric',
|
|
|
|
}
|
|
|
|
const now = new Date(date).toLocaleDateString(siteMetadata.locale, options)
|
|
|
|
|
|
|
|
return now
|
|
|
|
}
|
|
|
|
|
|
|
|
export default formatDate
|