fix date conversion (fix #66)

This commit is contained in:
Frédéric Harper
2021-05-19 18:10:17 -04:00
parent 5149472fcc
commit 3f41e6d52a
+6 -1
View File
@@ -157,7 +157,12 @@ async function loadImageFilePromise(imageUrl) {
}
function getPostPath(post, config) {
const dt = luxon.DateTime.fromISO(post.frontmatter.date);
let dt;
if (settings.custom_date_formatting) {
dt = luxon.DateTime.fromFormat(post.frontmatter.date, settings.custom_date_formatting);
} else {
dt = luxon.DateTime.fromISO(post.frontmatter.date);
}
// start with base output dir
const pathSegments = [config.output];