add timezone to settings.js

This commit is contained in:
mfuku
2021-05-13 20:04:52 +09:00
parent 5149472fcc
commit 5da56225fd
3 changed files with 1902 additions and 2 deletions
+1897 -1
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -110,7 +110,7 @@ function getPostTitle(post) {
}
function getPostDate(post) {
const dateTime = luxon.DateTime.fromRFC2822(post.pubDate[0], { zone: 'utc' });
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);
+4
View File
@@ -18,3 +18,7 @@ exports.custom_date_formatting = '';
// categories to be excluded from post frontmatter
// this does not filter out posts themselves, just the categories listed in their frontmatter
exports.filter_categories = ['uncategorized'];
// override date timezone
// it change date and slug to localized timezone, e.g. Asia/Tokyo
exports.custom_date_timezone = 'Asia/Tokyo';