Skip to content

Commit

Permalink
Fix incorrect rss months
Browse files Browse the repository at this point in the history
second argument to the Date() constructor is monthIndex 0-11
  • Loading branch information
rystaf authored and n0samu committed Jan 16, 2024
1 parent 35ad23b commit ba002a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/feed.xml/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function GET() {
? undefined
: new Date(
Number(posts[0].year),
Number(posts[0].month),
Number(posts[0].month)-1,
Number(posts[0].date),
),
feedLinks: {
Expand All @@ -27,7 +27,7 @@ export async function GET() {

for (const post of posts) {
feed.addItem({
date: new Date(Number(post.year), Number(post.month), Number(post.date)),
date: new Date(Number(post.year), Number(post.month)-1, Number(post.date)),
link: `https://ruffle.rs/blog/${post.year}/${post.month}/${post.date}/${post.slug}`,
title: post.title,
description: post.excerpt,
Expand Down

0 comments on commit ba002a3

Please sign in to comment.