diff --git a/src/components/ui/QCalendarMonthWrapper.vue b/src/components/ui/QCalendarMonthWrapper.vue
index 3ecea89c2..f99f6f4d7 100644
--- a/src/components/ui/QCalendarMonthWrapper.vue
+++ b/src/components/ui/QCalendarMonthWrapper.vue
@@ -59,12 +59,10 @@ const containerClasses = computed(() => {
// Clases para modificar el color de fecha seleccionada en componente QCalendarMonth
.q-dark div .q-calendar-mini .q-calendar-month__day.q-selected .q-calendar__button {
background-color: $primary !important;
- color: white !important;
}
.q-calendar-mini .q-calendar-month__day.q-selected .q-calendar__button {
background-color: $primary !important;
- color: white !important;
}
.q-calendar-month__head--weekday {
@@ -112,7 +110,6 @@ const containerClasses = computed(() => {
cursor: pointer;
}
}
-
.q-calendar-month__week--days > div:nth-child(6),
.q-calendar-month__week--days > div:nth-child(7) {
// Cambia el color de los días sábado y domingo
diff --git a/src/pages/Worker/Card/WorkerCalendar.vue b/src/pages/Worker/Card/WorkerCalendar.vue
index cfde97f93..ea6e62683 100644
--- a/src/pages/Worker/Card/WorkerCalendar.vue
+++ b/src/pages/Worker/Card/WorkerCalendar.vue
@@ -82,6 +82,7 @@ const onFetchAbsences = (data) => {
type: type.code,
absenceId: absence.id,
isFestive: false,
+ isHoliday: false,
});
});
}
diff --git a/src/pages/Worker/Card/WorkerCalendarItem.vue b/src/pages/Worker/Card/WorkerCalendarItem.vue
index 950557656..c48c083b9 100644
--- a/src/pages/Worker/Card/WorkerCalendarItem.vue
+++ b/src/pages/Worker/Card/WorkerCalendarItem.vue
@@ -126,7 +126,7 @@ const handleEventSelected = (event, { year, month, day }) => {
}
const date = new Date(year, month - 1, day);
- if (!event.absenceId) createEvent(date);
+ if (!event?.absenceId) createEvent(date);
else if (event.type == props.absenceType.code) deleteEvent(event, date);
else editEvent(event);
};
@@ -136,24 +136,31 @@ const getEventByTimestamp = ({ year, month, day }) => {
return props.events[stamp] || null;
};
+const isFestive = (timestamp) => {
+ const event = getEventByTimestamp(timestamp);
+ if (!event) return false;
+
+ const { isFestive } = event;
+ return isFestive;
+};
const getEventAttrs = (timestamp) => {
const event = getEventByTimestamp(timestamp);
if (!event) return {};
- const { name, color, isFestive } = event;
+ const { name, color, isFestive, type } = event;
// Atributos a asignar a cada slot que representa un evento en el calendario
const attrs = {
title: name,
- style: color ? `background-color: ${color};` : '',
+ style: color ? `background-color: ${color};` : ``,
label: timestamp.day,
};
if (isFestive) {
attrs.class = '--festive';
- attrs.label = event.absenceId ? timestamp.day : '';
- }
+ attrs.label = event.absenceId ?? timestamp.day;
+ } else attrs.class = `--${type}`;
return attrs;
};
@@ -162,7 +169,6 @@ const isToday = (timestamp) => {
const { year, month, day } = timestamp;
return todayTimestamp.value === new Date(year, month - 1, day).getTime();
};
-
onBeforeMount(() => {
updateSelectedDate(_year.value);
});
@@ -203,7 +209,6 @@ watch(_year, (newValue) => {
{