- small improvements
This commit is contained in:
parent
94350f8a82
commit
defc77635b
@ -13,7 +13,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
day.isHoliday && 'font-bold cursor-default',
|
day.isHoliday && 'font-bold cursor-default',
|
||||||
(day.isPendingVacation) && `border-b-4 border-dashed ${day.getVacationType.border} md:border-blumilk-600`
|
(day.isPendingVacation) && `border-b-4 border-dashed ${day.getVacationType.border}`,
|
||||||
|
(day.isVacation) && `border-b-4 ${day.getVacationType.border}`
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<Popper
|
<Popper
|
||||||
@ -33,7 +34,7 @@
|
|||||||
</time>
|
</time>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="py-2 px-6 text-sm font-semibold text-left text-gray-700 bg-white rounded-lg border border-gray-400">
|
<div class="py-2 px-6 text-sm font-semibold text-left text-gray-700 bg-white rounded-lg border border-gray-400">
|
||||||
{{ getHolidayDescription(day) }}
|
{{ day.getHolidayInfo }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Popper>
|
</Popper>
|
||||||
|
@ -132,7 +132,6 @@
|
|||||||
:day="day"
|
:day="day"
|
||||||
class="flex flex-col relative py-2 px-3"
|
class="flex flex-col relative py-2 px-3"
|
||||||
:class="{ 'day': calendarState.viewMode.isWeek }"
|
:class="{ 'day': calendarState.viewMode.isWeek }"
|
||||||
:get-holiday-description="getHolidayDescription"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -239,6 +238,7 @@ const customCalendar = {
|
|||||||
date: day.toISODate(),
|
date: day.toISODate(),
|
||||||
isVacation: isCurrentMonth && isVacation(day),
|
isVacation: isCurrentMonth && isVacation(day),
|
||||||
isPendingVacation: isCurrentMonth && isPendingVacation(day),
|
isPendingVacation: isCurrentMonth && isPendingVacation(day),
|
||||||
|
isHoliday: isHoliday(day),
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -247,7 +247,7 @@ const customCalendar = {
|
|||||||
isCurrentMonth,
|
isCurrentMonth,
|
||||||
isToday: isToday(day),
|
isToday: isToday(day),
|
||||||
isWeekend: isWeekend(day),
|
isWeekend: isWeekend(day),
|
||||||
isHoliday: isHoliday(day),
|
getHolidayInfo: startDay.isHoliday ? getHolidayInfo(startDay) : undefined,
|
||||||
getVacationType: startDay.isVacation || startDay.isPendingVacation ? getVacationType(startDay) : undefined,
|
getVacationType: startDay.isVacation || startDay.isPendingVacation ? getVacationType(startDay) : undefined,
|
||||||
getVacationInfo: startDay.isVacation || startDay.isPendingVacation ? getVacationInfo(startDay) : undefined,
|
getVacationInfo: startDay.isVacation || startDay.isPendingVacation ? getVacationInfo(startDay) : undefined,
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ function isHoliday(date) {
|
|||||||
return props.holidays[date.toISODate()] !== undefined
|
return props.holidays[date.toISODate()] !== undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHolidayDescription(day) {
|
function getHolidayInfo(day) {
|
||||||
return props.holidays[day.date]
|
return props.holidays[day.date]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,10 +365,6 @@ function isPendingVacation(date) {
|
|||||||
return props.pendingVacations[date.toISODate()] !== undefined
|
return props.pendingVacations[date.toISODate()] !== undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVacationBorder(day) {
|
|
||||||
return findType(getVacationInfo(day).type)?.border
|
|
||||||
}
|
|
||||||
|
|
||||||
function getVacationType(day) {
|
function getVacationType(day) {
|
||||||
return findType(getVacationInfo(day).type)
|
return findType(getVacationInfo(day).type)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user