Skip to content

Commit

Permalink
Find better starting week per month
Browse files Browse the repository at this point in the history
  • Loading branch information
brianschwabauer committed Jan 9, 2024
1 parent 5efa0e6 commit f43b86d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/CalendarQuarter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if (!settings.monthPage.disable) return month.id;
if (!settings.weekPage.disable) {
const week = settings.weeks.find(
(week) => week.start >= month.weekStart && week.start <= month.end,
(week) => week.month === month.month && week.year === month.year,
);
return week ? week.id : '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/CalendarYear.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if (!settings.monthPage.disable) return month.id;
if (!settings.weekPage.disable) {
const week = settings.weeks.find(
(week) => week.start >= month.weekStart && week.start <= month.end,
(week) => week.month === month.month && week.year === month.year,
);
return week ? week.id : '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/NotesQuarter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (!settings.monthPage.disable) return month.id;
if (!settings.weekPage.disable) {
const week = settings.weeks.find(
(week) => week.start >= month.weekStart && week.start <= month.end,
(week) => week.month === month.month && week.year === month.year,
);
return week ? week.id : '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/NotesYear.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (!settings.monthPage.disable) return month.id;
if (!settings.weekPage.disable) {
const week = settings.weeks.find(
(week) => week.start >= month.weekStart && week.start <= month.end,
(week) => week.month === month.month && week.year === month.year,
);
return week ? week.id : '';
}
Expand Down

0 comments on commit f43b86d

Please sign in to comment.