mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix "getNoteStartingWith" relic
This commit is contained in:
parent
a810c08c02
commit
d9550dd59b
@ -56,8 +56,7 @@ function getYearNote(dateStr, rootNote) {
|
||||
|
||||
const yearStr = dateStr.substr(0, 4);
|
||||
|
||||
let yearNote = attributeService.getNoteWithLabel(YEAR_LABEL, yearStr)
|
||||
|| getNoteStartingWith(rootNote.noteId, yearStr);
|
||||
let yearNote = attributeService.getNoteWithLabel(YEAR_LABEL, yearStr);
|
||||
|
||||
if (yearNote) {
|
||||
return yearNote;
|
||||
@ -103,18 +102,12 @@ function getMonthNote(dateStr, rootNote) {
|
||||
return monthNote;
|
||||
}
|
||||
|
||||
const yearNote = getYearNote(dateStr, rootNote);
|
||||
|
||||
monthNote = getNoteStartingWith(yearNote.noteId, monthNumber);
|
||||
|
||||
if (monthNote) {
|
||||
return monthNote;
|
||||
}
|
||||
|
||||
const dateObj = dateUtils.parseLocalDate(dateStr);
|
||||
|
||||
const noteTitle = getMonthNoteTitle(rootNote, monthNumber, dateObj);
|
||||
|
||||
const yearNote = getYearNote(dateStr, rootNote);
|
||||
|
||||
sql.transactional(() => {
|
||||
monthNote = createNote(yearNote, noteTitle);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user