From 5675e6366beff292eb9ee91fd265986f5d25dd33 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 14 Apr 2025 18:36:54 +0300 Subject: [PATCH] chore(api): document `getWeekNote` --- src/services/date_notes.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/services/date_notes.ts b/src/services/date_notes.ts index 44c5b07aa..ee88702ab 100644 --- a/src/services/date_notes.ts +++ b/src/services/date_notes.ts @@ -401,6 +401,13 @@ function getWeekFirstDayNote(dateStr: string, rootNote: BNote | null = null) { return getDayNote(weekStartDate.format("YYYY-MM-DD"), rootNote); } +/** + * Returns the {@link BNote} corresponding to the given week. If there is no note associated yet to that week, it will be created and returned instead. + * + * @param weekStr the week for which to return the corresponding note, in the format `2024-W04`. + * @param _rootNote a {@link BNote} representing the calendar root, or {@code null} or not specified to use the default root calendar note. + * @returns a Promise that resolves to the {@link BNote} corresponding to the week note. + */ async function getWeekNote(weekStr: string, _rootNote: BNote | null = null): Promise { const rootNote = _rootNote || getRootCalendarNote(); if (!rootNote.hasLabel("enableWeekNote")) {