This commit is contained in:
inherentlee committed 2026-10-18 11:10:35 -07:00
1 parent 9e64deb336
commit f68cd37b08
1 file changed
+6 -6
+6 -6
View File
@@ -18,12 +18,6 @@ export default function (eleventyConfig) {
return collection.slice(0, n);
});
/* Check if a dateTime happened before the current dateTime */
eleventyConfig.addFilter("inThePast", (dateString) => {
if (DateTime.fromISO(dateString) < DateTime.now()) return true;
return false;
});
/* Check if dates occurred on the same day */
eleventyConfig.addFilter("dateStringsEqual", (dateString1, dateString2) => {
const date1 = DateTime.fromISO(dateString1);
@@ -39,6 +33,12 @@ export default function (eleventyConfig) {
return DateTime.fromISO(dateString, { zone: zone || "utc" }).toFormat("yyyy-LL-dd");
});
/* Check if a dateTime happened before the current dateTime */
eleventyConfig.addFilter("inThePast", (dateString) => {
if (DateTime.fromISO(dateString) < DateTime.now()) return true;
return false;
});
/* What it says on the tin */
eleventyConfig.addFilter("randomize", function (array) {
// Create a copy of the array to avoid modifying the original