merge master and move code as needed

This commit is contained in:
Will Boyd
2024-02-27 08:13:37 -05:00
21 changed files with 686 additions and 1864 deletions
+16
View File
@@ -0,0 +1,16 @@
const luxon = require('luxon');
const settings = require('../settings');
// get post date, optionally formatted as specified in settings
module.exports = (post) => {
const dateTime = luxon.DateTime.fromRFC2822(post.pubDate[0], { zone: settings.custom_date_timezone || 'utc' });
if (settings.custom_date_formatting) {
return dateTime.toFormat(settings.custom_date_formatting);
} else if (settings.include_time_with_date) {
return dateTime.toISO();
} else {
return dateTime.toISODate();
}
};