selection of previous days restored
Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Adrian Hopek <adrian.hopek@blumilk.pl>
This commit is contained in:
parent
44b856d841
commit
2be881381d
@ -42,7 +42,6 @@ class CalendarGenerator
|
||||
"isToday" => $day->isToday(),
|
||||
"isWeekend" => $day->isWeekend(),
|
||||
"isHoliday" => $holidays->contains($day),
|
||||
"isFuture" => $day->isFuture(),
|
||||
"vacations" => $vacationsForDay->pluck("user_id"),
|
||||
"vacationTypes" => $vacationsForDay->pluck("vacationRequest.type", "user_id"),
|
||||
];
|
||||
|
@ -74,7 +74,7 @@
|
||||
</Popper>
|
||||
<button
|
||||
v-else-if="day.isWeekend"
|
||||
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500 hover:bg-transparent cursor-not-allowed"
|
||||
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500 hover:bg-transparent"
|
||||
>
|
||||
<time
|
||||
:datetime="day.date.toISODate()"
|
||||
@ -83,11 +83,8 @@
|
||||
{{ day.date.day }}
|
||||
</time>
|
||||
</button>
|
||||
<template
|
||||
v-else
|
||||
>
|
||||
<InertiaLink
|
||||
v-if="day.isFuture"
|
||||
v-else
|
||||
href="/vacation/requests/create"
|
||||
:data="{ 'from_date': day.date.toISODate() }"
|
||||
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500"
|
||||
@ -99,18 +96,6 @@
|
||||
{{ day.date.day }}
|
||||
</time>
|
||||
</InertiaLink>
|
||||
<button
|
||||
v-else
|
||||
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500 hover:bg-transparent cursor-not-allowed"
|
||||
>
|
||||
<time
|
||||
:datetime="day.date.toISODate()"
|
||||
class="mx-auto flex h-7 w-7 p-4 items-center justify-center"
|
||||
>
|
||||
{{ day.date.day }}
|
||||
</time>
|
||||
</button>
|
||||
</template>
|
||||
</template>
|
||||
<div
|
||||
v-else
|
||||
@ -170,7 +155,6 @@ for (let i = 1; i < 13; i++) {
|
||||
isVacation: isCurrentMonth && isVacation(day),
|
||||
isPendingVacation: isCurrentMonth && isPendingVacation(day),
|
||||
isHoliday: isHoliday(day),
|
||||
isFuture: isFuture(day),
|
||||
})
|
||||
}
|
||||
|
||||
@ -193,10 +177,6 @@ function isToday(date) {
|
||||
return DateTime.now().hasSame(date, 'year') && DateTime.now().hasSame(date, 'day')
|
||||
}
|
||||
|
||||
function isFuture(date) {
|
||||
return date.toISODate().toString() >= DateTime.now().toISODate().toString()
|
||||
}
|
||||
|
||||
function isInCurrentMonth(date, currentMonth) {
|
||||
return currentMonth.hasSame(date, 'month')
|
||||
}
|
||||
@ -215,12 +195,3 @@ function getVacationInfo(day) {
|
||||
return day.isVacation ? props.vacations[day.date.toISODate()] : props.pendingVacations[day.date.toISODate()]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
.cursor-default {
|
||||
cursor: auto;
|
||||
}
|
||||
.cursor-not-allowed {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
|
@ -111,7 +111,7 @@
|
||||
<VacationTypeCalendarIcon :type="day.vacationTypes[user.id]" />
|
||||
</div>
|
||||
<template
|
||||
v-else-if="isActiveDay(user.id + '+' + day.date) && !day.isWeekend && !day.isHoliday && day.isFuture && (auth.user.id === user.id || can.createOnBehalfOfEmployee)"
|
||||
v-else-if="isActiveDay(user.id + '+' + day.date) && !day.isWeekend && !day.isHoliday && (auth.user.id === user.id || can.createOnBehalfOfEmployee)"
|
||||
>
|
||||
<InertiaLink
|
||||
href="/vacation/requests/create"
|
||||
|
Loading…
x
Reference in New Issue
Block a user