Skip to content

Commit 5a7c291

Browse files
committed
fix(mcp): use local date instead of UTC for new blog posts
1 parent 3a9e574 commit 5a7c291

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/mcp-server/index.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@ async function createPost(args) {
5959
await fs.writeFile(filePath, content, 'utf-8');
6060

6161
// Add to metadata
62+
const today = new Date();
63+
const dateStr = today.getFullYear() + '-' +
64+
String(today.getMonth() + 1).padStart(2, '0') + '-' +
65+
String(today.getDate()).padStart(2, '0');
66+
6267
const newPost = {
6368
slug,
6469
title,
65-
date: new Date().toISOString().split('T')[0],
66-
updated: new Date().toISOString().split('T')[0],
70+
date: dateStr,
71+
updated: dateStr,
6772
description,
6873
tags: tags ? tags.split(',').map(t => t.trim()) : [],
6974
category: category || 'dev',

0 commit comments

Comments
 (0)