lewisdale.dev/config/filters/dates.js
2023-02-15 20:38:52 +00:00

7 lines
264 B
JavaScript

module.exports = function(eleventyConfig) {
eleventyConfig.addFilter('parseDate', dateString => new Date(dateString));
eleventyConfig.addFilter('dateDisplay', date => new Date(date).toLocaleDateString('en-GB', {
"dateStyle": "short"
}));
}