fix: update attendance month handling to use lastMonths and correct month indexing

This commit is contained in:
2026-01-06 20:58:14 +01:00
parent 870c36a15d
commit 356c1b3295
4 changed files with 28 additions and 11 deletions

View File

@@ -12,7 +12,8 @@ export const useAttendanceStore = defineStore('attendanceStore', () => {
const days = ref([])
// const lastThreeMonth = ['lipiec', 'czerwiec', 'maj']
const lastThreeMonth = utils.getLastMonths(new Date().getMonth() + 1, 5)
// const lastMonths = ref(utils.getLastMonthsWithYear(5))
const lastMonths = utils.getLastMonthsWithYear(5)
const sumOfHours = computed(() => days.value[days.value.length - 1]?.accumulatedHours || 0)
const workedHours = computed(() => sumOfHours.value - holidayHours.value - sickHours.value)
const overtimeHours = computed(() => days.value[days.value.length - 1]?.balanceHours || 0)
@@ -115,7 +116,7 @@ export const useAttendanceStore = defineStore('attendanceStore', () => {
holidayHours,
sickHours,
toGoHours,
lastThreeMonth,
lastMonths,
// actions
loadFromResponse,
updateDay,