mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-17 21:53:49 +09:00
merge master and move code as needed
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user