( date: Date, settings: VaultSettings, pattern: DateNotePatternSettings )
| 925 | } |
| 926 | |
| 927 | function weeklyNoteLocationForPattern( |
| 928 | date: Date, |
| 929 | settings: VaultSettings, |
| 930 | pattern: DateNotePatternSettings |
| 931 | ): WeeklyNoteLocation { |
| 932 | const weekYear = getISOWeekYear(date) |
| 933 | const week = getISOWeek(date) |
| 934 | const monday = mondayOfISOWeek(weekYear, week) |
| 935 | const locale = pattern.locale ?? DEFAULT_WEEKLY_NOTE_LOCALE |
| 936 | const patternParts = { year: weekYear, week } |
| 937 | const subpath = normalizePrimaryRelativeSubpath( |
| 938 | normalizeWeeklyNotesDirectory( |
| 939 | formatDirectoryPattern(monday, pattern.directory, locale, patternParts) |
| 940 | ), |
| 941 | settings |
| 942 | ) |
| 943 | const title = normalizeWeeklyNoteTitlePattern( |
| 944 | formatDateNotePattern( |
| 945 | monday, |
| 946 | pattern.titlePattern ?? DEFAULT_WEEKLY_NOTE_TITLE_PATTERN, |
| 947 | locale, |
| 948 | patternParts |
| 949 | ) |
| 950 | ) |
| 951 | return { title, subpath } |
| 952 | } |
| 953 | |
| 954 | /** |
| 955 | * Numerics a note's directory + title expose, used only to bound the set of |
no test coverage detected