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