diff --git a/src/routes/_libraries/blog.$.tsx b/src/routes/_libraries/blog.$.tsx index 5922289d4..45d69d6ce 100644 --- a/src/routes/_libraries/blog.$.tsx +++ b/src/routes/_libraries/blog.$.tsx @@ -101,7 +101,7 @@ function BlogPost() { const blogContent = `_by ${formatAuthors(authors)} on ${format( new Date(published || 0), - 'MMM dd, yyyy', + 'MMMM d, yyyy', )}._ ${content}` diff --git a/src/routes/_libraries/blog.index.tsx b/src/routes/_libraries/blog.index.tsx index 6d095659e..1d5352eb1 100644 --- a/src/routes/_libraries/blog.index.tsx +++ b/src/routes/_libraries/blog.index.tsx @@ -88,10 +88,10 @@ function BlogIndex() { {published ? ( ) : null}

diff --git a/src/utils/dates.ts b/src/utils/dates.ts index ddb5375e3..502c5135a 100644 --- a/src/utils/dates.ts +++ b/src/utils/dates.ts @@ -81,6 +81,14 @@ export function format(date: Date | number, formatStr: string): string { day: 'numeric', }) + case 'MMMM d, yyyy': + // "April 29, 2023" + return d.toLocaleDateString('en-US', { + year: 'numeric', + month: 'long', + day: 'numeric', + }) + case 'yyyy-MM-dd': // "2023-04-29" return d.toISOString().split('T')[0]