generated from inherentlee/11ty
Compare commits
2
Commits
a605a05943
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f68cd37b08 | ||
|
|
9e64deb336 |
No files matched your search
@@ -140,7 +140,7 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"removable": true,
|
"removable": true,
|
||||||
"allowUpload": true,
|
"allowUpload": true,
|
||||||
"root": "/src/ics",
|
"root": "/ics",
|
||||||
"filetypes": [
|
"filetypes": [
|
||||||
"ics"
|
"ics"
|
||||||
]
|
]
|
||||||
|
|||||||
+6
-6
@@ -18,12 +18,6 @@ export default function (eleventyConfig) {
|
|||||||
return collection.slice(0, n);
|
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 */
|
/* Check if dates occurred on the same day */
|
||||||
eleventyConfig.addFilter("dateStringsEqual", (dateString1, dateString2) => {
|
eleventyConfig.addFilter("dateStringsEqual", (dateString1, dateString2) => {
|
||||||
const date1 = DateTime.fromISO(dateString1);
|
const date1 = DateTime.fromISO(dateString1);
|
||||||
@@ -39,6 +33,12 @@ export default function (eleventyConfig) {
|
|||||||
return DateTime.fromISO(dateString, { zone: zone || "utc" }).toFormat("yyyy-LL-dd");
|
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 */
|
/* What it says on the tin */
|
||||||
eleventyConfig.addFilter("randomize", function (array) {
|
eleventyConfig.addFilter("randomize", function (array) {
|
||||||
// Create a copy of the array to avoid modifying the original
|
// Create a copy of the array to avoid modifying the original
|
||||||
|
|||||||
Whitespace-only changes.
Reference in new issue
Block a user