diff --git a/resources/js/Shared/Widgets/Calendar/DayComponent.vue b/resources/js/Shared/Widgets/Calendar/DayComponent.vue
index 9de95d7..8cc6fc7 100644
--- a/resources/js/Shared/Widgets/Calendar/DayComponent.vue
+++ b/resources/js/Shared/Widgets/Calendar/DayComponent.vue
@@ -13,7 +13,7 @@
}
],
day.isHoliday && 'font-bold cursor-default',
- (day.isVacation || day.isPendingVacation) && `border-b-4 border-dashed ${getVacationBorder(day)}`
+ (day.isPendingVacation) && `border-b-4 border-dashed ${day.getVacationType.border} md:border-blumilk-600`
]"
>
-
+
+
+
+
+
+
-
+
@@ -237,15 +235,21 @@ const customCalendar = {
},
prepareDay(day) {
const isCurrentMonth = isInCurrentMonth(day)
- return {
+ const startDay = {
date: day.toISODate(),
+ isVacation: isCurrentMonth && isVacation(day),
+ isPendingVacation: isCurrentMonth && isPendingVacation(day),
+ }
+
+ return {
+ ...startDay,
dayNumber: day.day,
- isCurrentMonth: isCurrentMonth,
+ isCurrentMonth,
isToday: isToday(day),
isWeekend: isWeekend(day),
isHoliday: isHoliday(day),
- isVacation: isCurrentMonth && isVacation(day),
- isPendingVacation: isCurrentMonth && isPendingVacation(day),
+ getVacationType: startDay.isVacation || startDay.isPendingVacation ? getVacationType(startDay) : undefined,
+ getVacationInfo: startDay.isVacation || startDay.isPendingVacation ? getVacationInfo(startDay) : undefined,
}
},
}
@@ -365,6 +369,10 @@ function getVacationBorder(day) {
return findType(getVacationInfo(day).type)?.border
}
+function getVacationType(day) {
+ return findType(getVacationInfo(day).type)
+}
+
function getVacationInfo(day) {
return day.isVacation ? props.approvedVacations[day.date] : props.pendingVacations[day.date]
}