fix {isoDate} template variable in journal date naming, closes #2306

This commit is contained in:
zadam 2021-11-04 19:56:45 +01:00
parent 57b7f6199e
commit 4733de23ba
2 changed files with 6 additions and 1 deletions

View file

@ -146,7 +146,7 @@ function getDateNoteTitle(rootNote, dayNumber, dateObj) {
return pattern
.replace(/{dayInMonthPadded}/g, dayNumber)
.replace(/{isoDate}/g, dateUtils.utcDateTimeStr(dateObj))
.replace(/{isoDate}/g, dateUtils.utcDateStr(dateObj))
.replace(/{weekDay}/g, weekDay)
.replace(/{weekDay3}/g, weekDay.substr(0, 3))
.replace(/{weekDay2}/g, weekDay.substr(0, 2));

View file

@ -30,6 +30,10 @@ function pad(num) {
return num <= 9 ? `0${num}` : `${num}`;
}
function utcDateStr(date) {
return date.toISOString().split('T')[0];
}
function utcDateTimeStr(date) {
return date.toISOString().replace('T', ' ');
}
@ -68,6 +72,7 @@ module.exports = {
utcNowDateTime,
localNowDateTime,
localNowDate,
utcDateStr,
utcDateTimeStr,
parseDate,
parseDateTime,