+
Cz
-
+
Pt
-
+
Sb
-
@@ -132,7 +129,6 @@
:day="day"
class="flex flex-col relative py-2 px-3"
:class="{ 'day': calendarState.viewMode.isWeek }"
- :get-holiday-description="getHolidayDescription"
/>
@@ -239,6 +235,7 @@ const customCalendar = {
date: day.toISODate(),
isVacation: isCurrentMonth && isVacation(day),
isPendingVacation: isCurrentMonth && isPendingVacation(day),
+ isHoliday: isHoliday(day),
}
return {
@@ -247,7 +244,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,
}
@@ -260,18 +257,22 @@ watch([calendar.viewMode, calendar.currents], () => {
customCalendar.loadCalendar()
-function toLast() {
- if (calendar.viewMode.value === 'week')
- minusWeek()
- else
- minusMonth()
+function toPrevious() {
+ if (calendarState.isPrevious) {
+ if (calendar.viewMode.value === 'week')
+ minusWeek()
+ else
+ minusMonth()
+ }
}
function toNext() {
- if (calendar.viewMode.value === 'week')
- addWeek()
- else
- addMonth()
+ if (calendarState.isNext) {
+ if (calendar.viewMode.value === 'week')
+ addWeek()
+ else
+ addMonth()
+ }
}
function resetCalendar(config = {}) {
@@ -353,7 +354,7 @@ function isHoliday(date) {
return props.holidays[date.toISODate()] !== undefined
}
-function getHolidayDescription(day) {
+function getHolidayInfo(day) {
return props.holidays[day.date]
}
@@ -365,10 +366,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)
}