From b13abf30986804397ba6d065fbccd00003cbdc08 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:33:10 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20substring=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/date_notes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/date_notes.ts b/src/services/date_notes.ts index 6e64ecc53..b078d3316 100644 --- a/src/services/date_notes.ts +++ b/src/services/date_notes.ts @@ -119,7 +119,7 @@ function getMonthNote(dateStr: string, _rootNote: BNote | null = null): BNote { const rootNote = _rootNote || getRootCalendarNote(); const monthStr = dateStr.substring(0, 7); - const monthNumber = dateStr.substring(5, 2); + const monthNumber = dateStr.substring(5, 7); let monthNote = searchService.findFirstNoteWithQuery(`#${MONTH_LABEL}="${monthStr}"`, new SearchContext({ ancestorNoteId: rootNote.noteId })); @@ -182,7 +182,7 @@ function getDayNote(dateStr: string, _rootNote: BNote | null = null): BNote { } const monthNote = getMonthNote(dateStr, rootNote); - const dayNumber = dateStr.substring(8, 2); + const dayNumber = dateStr.substring(8, 10); const dateObj = dateUtils.parseLocalDate(dateStr);