mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-20 07:04:14 +09:00
Small tweaks, comments
This commit is contained in:
@@ -3,8 +3,9 @@ const luxon = require('luxon');
|
|||||||
const settings = require('../settings');
|
const settings = require('../settings');
|
||||||
|
|
||||||
// get post date, optionally formatted as specified in settings
|
// get post date, optionally formatted as specified in settings
|
||||||
|
// this value is also used for year/month folders, date prefixes, etc. as needed
|
||||||
module.exports = (post) => {
|
module.exports = (post) => {
|
||||||
const dateTime = luxon.DateTime.fromRFC2822(post.pubDate[0], { zone: settings.custom_date_timezone || 'utc' });
|
const dateTime = luxon.DateTime.fromRFC2822(post.pubDate[0], { zone: settings.custom_date_timezone });
|
||||||
|
|
||||||
if (settings.custom_date_formatting) {
|
if (settings.custom_date_formatting) {
|
||||||
return dateTime.toFormat(settings.custom_date_formatting);
|
return dateTime.toFormat(settings.custom_date_formatting);
|
||||||
|
|||||||
+4
-3
@@ -18,6 +18,10 @@ exports.image_file_request_delay = 500;
|
|||||||
// overloaded.
|
// overloaded.
|
||||||
exports.markdown_file_write_delay = 25;
|
exports.markdown_file_write_delay = 25;
|
||||||
|
|
||||||
|
// Specify the timezone used for post dates. See available zone values and examples here:
|
||||||
|
// https://moment.github.io/luxon/#/zones?id=specifying-a-zone.
|
||||||
|
exports.custom_date_timezone = 'utc';
|
||||||
|
|
||||||
// Enable this to include time with post dates. For example, "2020-12-25" would become
|
// Enable this to include time with post dates. For example, "2020-12-25" would become
|
||||||
// "2020-12-25T11:20:35.000Z".
|
// "2020-12-25T11:20:35.000Z".
|
||||||
exports.include_time_with_date = false;
|
exports.include_time_with_date = false;
|
||||||
@@ -31,6 +35,3 @@ exports.custom_date_formatting = '';
|
|||||||
// just the categories listed in their frontmatter.
|
// just the categories listed in their frontmatter.
|
||||||
exports.filter_categories = ['uncategorized'];
|
exports.filter_categories = ['uncategorized'];
|
||||||
|
|
||||||
// override date timezone
|
|
||||||
// it change date and slug to localized timezone, e.g. Asia/Tokyo
|
|
||||||
// exports.custom_date_timezone = 'utc';
|
|
||||||
|
|||||||
Reference in New Issue
Block a user