Undo timezone jiggery-pokery.

This commit is contained in:
2026-01-07 20:44:45 -06:00
parent 28b657d871
commit 2c5efe83d9

View File

@@ -17,29 +17,7 @@ const figoptions = {
figcaption: true,
};
const timeZone = "America/Chicago";
export default async function (eleventyConfig) {
// Helper Functions
eleventyConfig.addDateParsing((dateValue) => {
let localDate;
if (dateValue instanceof Date) {
// and YAML
localDate = DateTime.fromJSDate(dateValue, { zone: "utc" }).setZone(
timeZone,
{ keepLocalTime: true },
);
} else if (typeof dateValue === "string") {
localDate = DateTime.fromISO(dateValue, { zone: timeZone });
}
if (localDate?.isValid === false) {
throw new Error(
`Invalid \`date\` value (${dateValue}) is invalid for ${this.page.inputPath}: ${localDate.invalidReason}`,
);
}
return localDate;
});
// Collections
eleventyConfig.addCollection("galleryImages", (collection) => {
const galleries = collection.getAll()[0].data.galleries;