Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions scripts/new-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import fs from "fs"
import path from "path"

function getDate() {
const today = new Date()
const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, "0")
const day = String(today.getDate()).padStart(2, "0")

return `${year}-${month}-${day}`
return new Date().toISOString()
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toISOString() method returns a full ISO 8601 timestamp (e.g., '2023-08-15T14:30:00.000Z') instead of just the date portion (e.g., '2023-08-15'). This breaks the expected format and likely affects downstream code that expects only the date. Consider using toISOString().split('T')[0] to extract just the date portion.

Suggested change
return new Date().toISOString()
return new Date().toISOString().split('T')[0]

Copilot uses AI. Check for mistakes.

}

const args = process.argv.slice(2)
Expand Down