2023-02-08 09:29:44 +00:00
|
|
|
module.exports = function(eleventyConfig) {
|
2023-11-29 08:34:39 +00:00
|
|
|
eleventyConfig.addFilter('parseDate', dateString => new Date(dateString));
|
2023-02-16 14:10:05 +00:00
|
|
|
|
2023-11-29 08:34:39 +00:00
|
|
|
eleventyConfig.addFilter('dateDisplay', date => new Date(date).toLocaleDateString('en-GB', {
|
|
|
|
"dateStyle": "short"
|
|
|
|
}));
|
2023-02-16 14:10:05 +00:00
|
|
|
|
2023-11-29 08:34:39 +00:00
|
|
|
eleventyConfig.addFilter('dateTimeDisplay', date => new Date(date).toLocaleString('en-GB', {
|
|
|
|
'dateStyle': 'short',
|
|
|
|
'timeStyle': 'short',
|
|
|
|
}));
|
|
|
|
|
|
|
|
eleventyConfig.addFilter('timeDisplay', date => new Date(date).toLocaleTimeString('en-GB', {
|
|
|
|
'hour': '2-digit',
|
|
|
|
'minute': 'numeric',
|
|
|
|
'hour12': true
|
|
|
|
}));
|
|
|
|
|
2024-04-09 07:15:27 +00:00
|
|
|
eleventyConfig.addGlobalData('isCSSNakedDay', () => {
|
|
|
|
const dateObj = new Date();
|
|
|
|
|
|
|
|
return dateObj.getMonth() === 3 && dateObj.getFullYear() === 2024 && dateObj.getDate() === 9;
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-30 15:38:09 +00:00
|
|
|
// eleventyConfig.addFilter('rfc3339', date => new Date(date).toISOString());
|
2023-11-29 08:34:39 +00:00
|
|
|
}
|