diff --git a/frontend/mockdata/mockData.ts b/frontend/mockdata/mockData.ts index 367dd6e2..80b9cf8b 100644 --- a/frontend/mockdata/mockData.ts +++ b/frontend/mockdata/mockData.ts @@ -17,7 +17,7 @@ const MockWeeklyBookingReadModel: WeeklyBookingReadModel = { totalSellableTime: 0, totalBillable: 0, totalOffered: 0, - totalVacationHours: 10, + totalVacationHours: 0, totalExcludableAbsence: 0, totalNotStartedOrQuit: 0, }; @@ -79,11 +79,11 @@ export const MockConsultants: ConsultantReadModel[] = [ department: { id: "mydepartment", name: "My Department" }, bookings: [ { - year: 2025, - weekNumber: 14, + year: 2023, + weekNumber: 10, dateString: "", bookingModel: MockWeeklyBookingReadModel, - sortableWeek: 202514, + sortableWeek: 202310, }, ], yearsOfExperience: 23, diff --git a/frontend/src/components/Forecast/TransformWeekDataToMonth.ts b/frontend/src/components/Forecast/TransformWeekDataToMonth.ts index 52f057f8..ffdcf923 100644 --- a/frontend/src/components/Forecast/TransformWeekDataToMonth.ts +++ b/frontend/src/components/Forecast/TransformWeekDataToMonth.ts @@ -17,12 +17,12 @@ function transformToMonthlyData(weeklyData: BookedHoursPerWeek[]) { const { year, weekNumber, bookingModel } = week; const monthDistribution = getMonthOfWeek({ week: weekNumber, year: year }); const primaryMonthKey = `${monthDistribution.year}-${String( - monthDistribution.month + 1, + monthDistribution.month, ).padStart(2, "0")}`; const secondaryMonthKey = monthDistribution.secondMonth !== undefined ? `${monthDistribution.year}-${String( - monthDistribution.secondMonth + 1, + monthDistribution.secondMonth, ).padStart(2, "0")}` : null; @@ -76,6 +76,7 @@ function transformToMonthlyData(weeklyData: BookedHoursPerWeek[]) { addToMonthlyData(secondaryMonthKey, secondaryBookingModel!); } }); + console.log("monthlyData", Object.values(monthlyData)); return Object.values(monthlyData); }