In month note title patterns, replace {isoMonth} with e.g. "2025-03" for March 2025.

This commit is contained in:
Joel Shprentz 2025-03-20 22:59:20 +00:00
parent d189f2b66b
commit 5f26a503af
3 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,7 @@ It's possible to customize the title of generated date notes by defining a `#dat
It is also possible to customize the title of generated month notes through the `#monthPattern` attribute, much like `#datePattern`. The options are:
* `{isoDate}` results in an ISO 8061 formatted month (e.g. "2025-03" for March 2025)
* `{monthNumberPadded}` results in a number like `09` for September, and `11` for November
* `{month}` results in the full month name (e.g. `September` or `October`)
* `{shortMonth3}` is replaced with the first 3 letters of the month, e.g. Jan, Feb, etc.
@ -56,4 +57,4 @@ Trilium has some special support for day notes in the form of [backend Script AP
Day (and year, month) notes are created with a label - e.g. `#dateNote="2018-08-16"` this can then be used by other scripts to add new notes to day note etc.
Journal also has relation `child:child:child:template=Day template` (see \[\[attribute inheritance\]\]) which effectively adds \[\[template\]\] to day notes (grand-grand-grand children of Journal).
Journal also has relation `child:child:child:template=Day template` (see \[\[attribute inheritance\]\]) which effectively adds \[\[template\]\] to day notes (grand-grand-grand children of Journal).

View File

@ -76,6 +76,8 @@
the <code>#monthPattern</code> attribute, much like <code>#datePattern</code>.
The options are:</p>
<ul>
<li><code>{isoMonth}</code> results in an ISO 8061 formatted month (e.g.
"2025-03" for March 2025)</li>
<li><code>{monthNumberPadded}</code> results in a number like <code>09</code> for
September, and <code>11</code> for November</li>
<li><code>{month}</code> results in the full month name (e.g. <code>September</code> or <code>October</code>)</li>
@ -98,4 +100,4 @@
</div>
</body>
</html>
</html>

View File

@ -111,6 +111,7 @@ function getMonthNoteTitle(rootNote: BNote, monthNumber: string, dateObj: Date)
return pattern
.replace(/{shortMonth3}/g, monthName.slice(0, 3))
.replace(/{shortMonth4}/g, monthName.slice(0, 4))
.replace(/{isoMonth}/g, dateUtils.utcDateStr(dateObj).slice(0, 7))
.replace(/{monthNumberPadded}/g, monthNumber)
.replace(/{month}/g, monthName);
}