Fix dates and finish Tiny Accident
This commit is contained in:
parent
808f565e59
commit
b92f53a9c2
6 changed files with 86 additions and 71 deletions
|
|
@ -1,5 +1,8 @@
|
|||
import { defineCollection, reference, z } from "astro:content";
|
||||
|
||||
export const adjustDateForUTCOffset = (date: Date) =>
|
||||
new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
|
||||
|
||||
export const WEBSITE_LIST = [
|
||||
"website",
|
||||
"eka",
|
||||
|
|
@ -27,7 +30,7 @@ const storiesCollection = defineCollection({
|
|||
z.object({
|
||||
// Required
|
||||
title: z.string(),
|
||||
pubDate: z.date(),
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset),
|
||||
wordCount: z.number().int(),
|
||||
contentWarning: z.string(),
|
||||
description: z.string(),
|
||||
|
|
@ -59,7 +62,7 @@ const gamesCollection = defineCollection({
|
|||
z.object({
|
||||
// Required
|
||||
title: z.string(),
|
||||
pubDate: z.date(),
|
||||
pubDate: z.date().transform(adjustDateForUTCOffset),
|
||||
contentWarning: z.string(),
|
||||
description: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue