11 lines
239 B
TypeScript
11 lines
239 B
TypeScript
|
|
const postDateFormatter = new Intl.DateTimeFormat('en-US', {
|
||
|
|
month: 'long',
|
||
|
|
day: 'numeric',
|
||
|
|
year: 'numeric',
|
||
|
|
timeZone: 'UTC',
|
||
|
|
});
|
||
|
|
|
||
|
|
export function formatPostDate(date: string) {
|
||
|
|
return postDateFormatter.format(new Date(date));
|
||
|
|
}
|