diff --git a/scripts/prerender-meta.js b/scripts/prerender-meta.js index d2c48ca..2f04ac2 100644 --- a/scripts/prerender-meta.js +++ b/scripts/prerender-meta.js @@ -68,16 +68,19 @@ async function fetchDynamicMeta() { const articles = response.data; return articles.reduce((acc, article) => { - const updatedAt = new Date(article.updatedAt); - const formattedUpdatedAt = updatedAt.toLocaleDateString('de-DE', { + const createdAt = new Date(article.createdAt); + + // Format the date directly using toLocaleDateString + const formattedCreatedAt = createdAt.toLocaleDateString('en-US', { + month: 'short', + day: '2-digit', + year: 'numeric', hour: '2-digit', minute: '2-digit', - day: '2-digit', - month: '2-digit', - year: 'numeric', - }); + hour12: false, + }) - const description = `By ${article.authorName} | Last Updated: ${formattedUpdatedAt}`; + const description = `By ${article.authorName} | Article from ${formattedCreatedAt}`; acc[`/blog/${article.slug}`] = { title: article.title, diff --git a/src/app/article-page/article-page.component.html b/src/app/article-page/article-page.component.html index 45535a5..9cafe53 100644 --- a/src/app/article-page/article-page.component.html +++ b/src/app/article-page/article-page.component.html @@ -13,8 +13,7 @@

Author: {{ article.authorName}}

Views: {{ article.views }}


-

Created At: {{ article.createdAt | date:'medium' }}

-

Last Updated: {{ article.updatedAt | date:'medium' }}

+

Created At: {{ article.createdAt | date:'MMM dd, yyyy, HH:mm' }}

diff --git a/src/app/blog/blog.component.html b/src/app/blog/blog.component.html index dbce1c3..83aeab0 100644 --- a/src/app/blog/blog.component.html +++ b/src/app/blog/blog.component.html @@ -9,7 +9,7 @@

{{ (article.title | slice:0:45) + (article.title.length > 40 ? '...' : '')}}

{{ (article.content | slice:0:80) + (article.content.length > 80 ? '...' : '')}}

-

By {{ article.authorName }} | {{ article.createdAt | date: 'short' }}

+

By {{ article.authorName }} | {{ article.createdAt | date: 'dd/MM/yy, HH:mm' }}