Undo timezone jiggery-pokery.
This commit is contained in:
@@ -17,29 +17,7 @@ const figoptions = {
|
|||||||
figcaption: true,
|
figcaption: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const timeZone = "America/Chicago";
|
|
||||||
|
|
||||||
export default async function (eleventyConfig) {
|
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
|
// Collections
|
||||||
eleventyConfig.addCollection("galleryImages", (collection) => {
|
eleventyConfig.addCollection("galleryImages", (collection) => {
|
||||||
const galleries = collection.getAll()[0].data.galleries;
|
const galleries = collection.getAll()[0].data.galleries;
|
||||||
|
|||||||
Reference in New Issue
Block a user