Skip to content

Commit

Permalink
FIX: Set hours to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mazipan committed Oct 23, 2023
1 parent f58449f commit 917c626
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/sitemap-public-users.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { BASEURL, getAllPublicUsersForSiteMap } from '@/lib/api'
import type { UserProfile } from '@/lib/types'

const TODAY = new Date()
TODAY.setHours(0, 0, 0, 0)

function generateSitemap(data: UserProfile[]) {
return `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
Expand All @@ -9,7 +12,7 @@ function generateSitemap(data: UserProfile[]) {
return `
<url>
<loc>${`${BASEURL}/p/${user.slug}`}</loc>
<lastmod>${new Date().toISOString()}</lastmod>
<lastmod>${TODAY.toISOString()}</lastmod>
</url>
`
})
Expand Down

0 comments on commit 917c626

Please sign in to comment.