Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 5675e63

Browse files
committed
chore(api): document getWeekNote
1 parent 34a0470 commit 5675e63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/services/date_notes.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,13 @@ function getWeekFirstDayNote(dateStr: string, rootNote: BNote | null = null) {
401401
return getDayNote(weekStartDate.format("YYYY-MM-DD"), rootNote);
402402
}
403403

404+
/**
405+
* 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.
406+
*
407+
* @param weekStr the week for which to return the corresponding note, in the format `2024-W04`.
408+
* @param _rootNote a {@link BNote} representing the calendar root, or {@code null} or not specified to use the default root calendar note.
409+
* @returns a Promise that resolves to the {@link BNote} corresponding to the week note.
410+
*/
404411
async function getWeekNote(weekStr: string, _rootNote: BNote | null = null): Promise<BNote | null> {
405412
const rootNote = _rootNote || getRootCalendarNote();
406413
if (!rootNote.hasLabel("enableWeekNote")) {

0 commit comments

Comments
 (0)