Fixing weeks count

This commit is contained in:
Clayzxr
2025-01-27 12:37:40 +01:00
parent c3d33317b4
commit ea6b3d1f48
4 changed files with 10 additions and 9 deletions
@@ -89,9 +89,10 @@ export const handler: Handlers = {
const start = new Date(startDate);
const end = new Date(endDate);
if (start <= end) {
calculatedWeeksCount = Math.ceil((end.getTime() - start.getTime()) / (7 * 24 * 60 * 60 * 1000));
const differenceInDays = Math.ceil((end.getTime() - start.getTime()) / (24 * 60 * 60 * 1000));
calculatedWeeksCount = Math.floor(differenceInDays / 7);
} else {
calculatedWeeksCount = null;
calculatedWeeksCount = null;
}
}