Skip to content

Commit

Permalink
don't add week taskList if it's not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
fivaz committed Jun 1, 2024
1 parent 392be64 commit 843aafb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/dashboard/tasks/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export enum GROUPS {
}

function isCurrentWeek(date: Date) {
return startOfWeek(new Date()).getTime() === startOfWeek(date).getTime();
return (
startOfWeek(new Date(), { weekStartsOn: 1 }).getTime() ===
startOfWeek(date, { weekStartsOn: 1 }).getTime()
);
}

function isNextWeek(date: Date): boolean {
Expand Down Expand Up @@ -88,7 +91,6 @@ function groupTasksByDate(tasks: AnyTask[]): Record<string, AnyTask[]> {
[GROUPS.Someday]: [],
[GROUPS.Today]: [],
[GROUPS.Tomorrow]: [],
[GROUPS.Week]: [],
},
);
}
Expand Down

0 comments on commit 843aafb

Please sign in to comment.