From 9e54d3cc0b8bde9a72abd9b4bb80b9014c82624b Mon Sep 17 00:00:00 2001 From: Damillora Date: Tue, 17 Dec 2024 21:59:22 +0700 Subject: [PATCH] fix: update sitemap date formatting --- src/routes/sitemap.xml/+server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/sitemap.xml/+server.ts b/src/routes/sitemap.xml/+server.ts index 91c928e..1a166ad 100644 --- a/src/routes/sitemap.xml/+server.ts +++ b/src/routes/sitemap.xml/+server.ts @@ -1,5 +1,6 @@ import { json } from '@sveltejs/kit'; import { browseAllPost } from "$lib/content/contentApi"; +import dayjs from 'dayjs'; export async function GET() { @@ -17,7 +18,7 @@ export async function GET() { allPosts.map((_post) => { xml += '' xml += `${_post.url}` - xml += `${_post.date_updated}` + xml += `${dayjs(_post.date_updated).format('YYYY-MM-DDTHH:mm:ss[+07:00]')}` xml += `always` xml += `0.5` xml += ''