mirror of
https://github.com/zadam/trilium.git
synced 2024-11-11 18:08:13 +08:00
fix {isoDate} template variable in journal date naming, closes #2306
This commit is contained in:
parent
57b7f6199e
commit
4733de23ba
2 changed files with 6 additions and 1 deletions
|
@ -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));
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue