From aed95beea153896f864125bbcb5b431bd54a6a68 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Thu, 19 Sep 2024 01:44:03 -0400 Subject: [PATCH] change from mtime to dateCreated --- app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 9fee4ba..0f94044 100644 --- a/app.js +++ b/app.js @@ -84,10 +84,10 @@ function getAllBlogPosts(page = 1, postsPerPage = 5) { // Get the last modified date of the markdown file const stats = fs.statSync(path.join(__dirname, 'markdown', file)); - const lastModifiedDate = new Date(stats.mtime); // Use mtime for last modification time + const dateCreated = new Date(stats.birthtime); // Use mtime for last modification time // Format the date - const formattedDate = lastModifiedDate.toLocaleDateString('en-US', { + const formattedDate = dateCreated.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' @@ -270,7 +270,6 @@ app.get('/sitemap.xml', (req, res) => { }); -// RSS Feed Route // RSS Feed Route app.get('/rss', (req, res) => { const hostname = req.headers.host || 'http://localhost'; // Adjust for production if needed