- small improvements

This commit is contained in:
Kamil Niemczycki 2022-07-07 09:11:40 +02:00
parent 94350f8a82
commit defc77635b
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213
2 changed files with 6 additions and 9 deletions

View File

@ -13,7 +13,8 @@
}
],
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
@ -33,7 +34,7 @@
</time>
<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">
{{ getHolidayDescription(day) }}
{{ day.getHolidayInfo }}
</div>
</template>
</Popper>

View File

@ -132,7 +132,6 @@
:day="day"
class="flex flex-col relative py-2 px-3"
:class="{ 'day': calendarState.viewMode.isWeek }"
:get-holiday-description="getHolidayDescription"
/>
</div>
</div>
@ -239,6 +238,7 @@ const customCalendar = {
date: day.toISODate(),
isVacation: isCurrentMonth && isVacation(day),
isPendingVacation: isCurrentMonth && isPendingVacation(day),
isHoliday: isHoliday(day),
}
return {
@ -247,7 +247,7 @@ const customCalendar = {
isCurrentMonth,
isToday: isToday(day),
isWeekend: isWeekend(day),
isHoliday: isHoliday(day),
getHolidayInfo: startDay.isHoliday ? getHolidayInfo(startDay) : undefined,
getVacationType: startDay.isVacation || startDay.isPendingVacation ? getVacationType(startDay) : undefined,
getVacationInfo: startDay.isVacation || startDay.isPendingVacation ? getVacationInfo(startDay) : undefined,
}
@ -353,7 +353,7 @@ function isHoliday(date) {
return props.holidays[date.toISODate()] !== undefined
}
function getHolidayDescription(day) {
function getHolidayInfo(day) {
return props.holidays[day.date]
}
@ -365,10 +365,6 @@ function isPendingVacation(date) {
return props.pendingVacations[date.toISODate()] !== undefined
}
function getVacationBorder(day) {
return findType(getVacationInfo(day).type)?.border
}
function getVacationType(day) {
return findType(getVacationInfo(day).type)
}