This commit is contained in:
10
lib/format.ts
Normal file
10
lib/format.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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));
|
||||
}
|
||||
Reference in New Issue
Block a user