Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 85459d6

Browse files
committed
Updated week calculation. Signed commit. Fixes #85
1 parent 991eb02 commit 85459d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/contracts/FilterPanel.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ export default {
181181
break;
182182
case 'week': {
183183
const curr = start.getDay(),
184-
diff = start.getDate() - curr + (curr === 0 ? -6 : 1);
184+
diffB = start.getDate() - curr + (curr === 0 ? -6 : 1),
185+
diffE = start.getDate() + 6 - (curr === 0 ? 7 : curr);
185186
186-
start.setDate(diff);
187+
start.setDate(diffB);
187188
start.setHours(0, 0, 0, 0);
188-
end.setDate(start.getDate() + 7);
189+
end.setDate(diffE);
189190
end.setHours(23, 59, 59, 999);
190191
191192
break;
@@ -403,4 +404,4 @@ body.win32 {
403404
}
404405
}
405406
}
406-
</style>
407+
</style>

0 commit comments

Comments
 (0)