mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Merge pull request #1480 from jshprentz/develop
Add {isoMonth} month pattern to day notes
			
			
This commit is contained in:
		| @@ -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: | It is also possible to customize the title of generated month notes through the `#monthPattern` attribute, much like `#datePattern`. The options are: | ||||||
|  |  | ||||||
|  | *   `{isoMonth}` 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 | *   `{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`) | *   `{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. | *   `{shortMonth3}` is replaced with the first 3 letters of the month, e.g. Jan, Feb, etc. | ||||||
|   | |||||||
| @@ -76,6 +76,8 @@ | |||||||
|           the <code>#monthPattern</code> attribute, much like <code>#datePattern</code>. |           the <code>#monthPattern</code> attribute, much like <code>#datePattern</code>. | ||||||
|           The options are:</p> |           The options are:</p> | ||||||
|         <ul> |         <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 |           <li><code>{monthNumberPadded}</code> results in a number like <code>09</code> for | ||||||
|             September, and <code>11</code> for November</li> |             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> |           <li><code>{month}</code> results in the full month name (e.g. <code>September</code> or <code>October</code>)</li> | ||||||
|   | |||||||
| @@ -111,6 +111,7 @@ function getMonthNoteTitle(rootNote: BNote, monthNumber: string, dateObj: Date) | |||||||
|     return pattern |     return pattern | ||||||
|         .replace(/{shortMonth3}/g, monthName.slice(0, 3)) |         .replace(/{shortMonth3}/g, monthName.slice(0, 3)) | ||||||
|         .replace(/{shortMonth4}/g, monthName.slice(0, 4)) |         .replace(/{shortMonth4}/g, monthName.slice(0, 4)) | ||||||
|  |         .replace(/{isoMonth}/g, dateUtils.utcDateStr(dateObj).slice(0, 7)) | ||||||
|         .replace(/{monthNumberPadded}/g, monthNumber) |         .replace(/{monthNumberPadded}/g, monthNumber) | ||||||
|         .replace(/{month}/g, monthName); |         .replace(/{month}/g, monthName); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user