15 lines
284 B
JavaScript
15 lines
284 B
JavaScript
import siteMetadata from '@/data/siteMetadata'
|
|
|
|
const formatDate = (date) => {
|
|
const options = {
|
|
year: 'numeric',
|
|
month: 'long',
|
|
day: 'numeric',
|
|
}
|
|
const now = new Date(date).toLocaleDateString(siteMetadata.locale, options)
|
|
|
|
return now
|
|
}
|
|
|
|
export default formatDate
|