fix for "Today page does not work for 2021-11-20", closes #2359

This commit is contained in:
zadam
2021-11-30 21:21:16 +01:00
parent d64c14482b
commit 40fb4ff56b
3 changed files with 3 additions and 16 deletions

View File

@@ -25,15 +25,6 @@ function createNote(parentNote, noteTitle) {
}).note;
}
function getNoteStartingWith(parentNoteId, startsWith) {
const noteId = sql.getValue(`SELECT notes.noteId FROM notes JOIN branches USING(noteId)
WHERE parentNoteId = ? AND title LIKE '${startsWith}%'
AND notes.isDeleted = 0 AND isProtected = 0
AND branches.isDeleted = 0`, [parentNoteId]);
return becca.getNote(noteId);
}
/** @returns {Note} */
function getRootCalendarNote() {
let rootNote = attributeService.getNoteWithLabel(CALENDAR_ROOT_LABEL);
@@ -164,12 +155,6 @@ function getDateNote(dateStr) {
const monthNote = getMonthNote(dateStr, rootNote);
const dayNumber = dateStr.substr(8, 2);
dateNote = getNoteStartingWith(monthNote.noteId, dayNumber);
if (dateNote) {
return dateNote;
}
const dateObj = dateUtils.parseLocalDate(dateStr);
const noteTitle = getDateNoteTitle(rootNote, dayNumber, dateObj);