Skip to content

Commit

Permalink
Updated week calculation. Signed commit. Fixes siacentral#85
Browse files Browse the repository at this point in the history
  • Loading branch information
timrettop committed Nov 4, 2022
1 parent 991eb02 commit 85459d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/contracts/FilterPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ export default {
break;
case 'week': {
const curr = start.getDay(),
diff = start.getDate() - curr + (curr === 0 ? -6 : 1);
diffB = start.getDate() - curr + (curr === 0 ? -6 : 1),
diffE = start.getDate() + 6 - (curr === 0 ? 7 : curr);
start.setDate(diff);
start.setDate(diffB);
start.setHours(0, 0, 0, 0);
end.setDate(start.getDate() + 7);
end.setDate(diffE);
end.setHours(23, 59, 59, 999);
break;
Expand Down Expand Up @@ -403,4 +404,4 @@ body.win32 {
}
}
}
</style>
</style>

0 comments on commit 85459d6

Please sign in to comment.