fix: update attendance month handling to use lastMonths and correct month indexing
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user