trilium
trilium copied to clipboard
Add #calendarType attribute to support monthly or weekly notes
Add new attribute #calendarType
on calendar root note, its value can be monthly
(default) or weekly
.
If #calendarType=monthly
, then the calendar tree will be organized as "year/month/day", this is default option just like before;
if #calendarType=weekly
, then the calendar tree will be organized as "year/week/day".
Beside, year/month/week/day notes have their own title pattern: yearPattern
(new), monthPattern
, weekPattern
(new) and datePattern
, and they all support these macros:
-
{year}
: "YYYY" -
{month}
: month name -
{monthNumberPadded}
: "MM" -
{weekNumber}
(new): ISO week number -
{weekNumberPadded}
(new): "WW" -
{weekDay}
: week name -
{weekDay2}
the first two characters of week name -
{weekDay3}
: the first three characters of week name -
{dayInMonthPadded}
: "DD" -
{isoDate}
: "YYYY-MM-DD" (Add custom macros support?)
To implement the design of https://github.com/zadam/trilium/issues/3461, I added a new attribute #calendarPattern which can control the note tree of calendar.
The default value of #calendarPattern is "year/month/day", this will keep the default calendar tree like before.
The label in #calendarPattern can be one of "day", "week", "month" or "year", and there must be at least one "day" in it.
Thanks for any suggestions.
Hi, @zadam. In backend api document, BNote's cloneTo(parentNoteId) → {Object}
, what's object?
I think my logic might be right, but I encounter the following error message, would you like to give me some helps? Thank you very much!
"Encountered error "Process exceeded time limit 30000", check out the console."
Hi, @zadam. In backend api document, BNote's
cloneTo(parentNoteId) → {Object}
, what's object?
Unfortunately JSDoc does not support object declaration in @returns
, the value is better defined in the source.
"Encountered error "Process exceeded time limit 30000", check out the console."
This usually means that the WebSocket message (with entity updates) has crashed some component in the frontend. Usually you will find the source of the problem above in the console.
"Encountered error "Process exceeded time limit 30000", check out the console."
This usually means that the WebSocket message (with entity updates) has crashed some component in the frontend. Usually you will find the source of the problem above in the console.
Backend logs:
getParentNote day 2022-12-28
getWeekNote: find weekNote
getWeekNote: not year
getParentNote week 2022-12-28
getParentNote year 2022-12-28
Created new note 'szPqG5zh7kkj', branch 'u7dTta9kSl90_szPqG5zh7kkj' of type 'text', mime 'text/html'
getWeekNote: clone
Cloned note 'y9mnzt2gwt5E' to new parent note 'szPqG5zh7kkj' with prefix 'undefined'
getWeekNote: return
Created new note 'HMx7UmZwNJV9', branch 'y9mnzt2gwt5E_HMx7UmZwNJV9' of type 'text', mime 'text/html'
Slow 200 GET /api/special-notes/days/2022-12-28 with 301 bytes took 23ms
JS Error: Encountered error Process exceeded time limit 30000: timeLimit@http://127.0.0.1:8081/assets/v0.59.1/app/services/utils.js:293:28
@http://127.0.0.1:8081/assets/v0.59.1/app/services/ws.js:169:34
asyncFunctionResume@[native code]
@http://127.0.0.1:8081/assets/v0.59.1/app/services/ws.js:90:60
asyncFunctionResume@[native code]
@http://127.0.0.1:8081/assets/v0.59.1/app/services/ws.js:114:36
asyncFunctionResume@[native code], reloading frontend.
Stack: logError@http://127.0.0.1:8081/assets/v0.59.1/app/services/ws.js:24:29
@http://127.0.0.1:8081/assets/v0.59.1/app/services/ws.js:172:21
asyncFunctionResume@[native code]
@[native code]
promiseReactionJobWithoutPromise@[native code]
promiseReactionJob@[native code]
200 POST /api/tree/load with 7811 bytes took 1ms
Reproducer:
- Delete 2022 & 2023
- Create 2023-01-01 from calendar widget
- Create 2022-12-28 from calendar widget
Then you will timeout at frocaUpdater.processEntityChanges(nonProcessedEntityChanges)
.
But if you reload the web page, then "2022/W0*/28 - Wednesday" will be displayed normally.
BTW, if "2022" has been created already, then it will work fine.
I don't need this feature anymore. If someone needs it, glad to let me know.