From f893b2c1e5d5f8f90ad64b3984226e8bc682ac06 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov <me@slavatumanov.me> Date: Tue, 2 May 2023 21:30:15 +0500 Subject: [PATCH] TSK-1419: show greyed requests on holidays and weekends (#3121) Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me> --- .../hr-resources/src/components/ScheduleRequests.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/hr-resources/src/components/ScheduleRequests.svelte b/plugins/hr-resources/src/components/ScheduleRequests.svelte index dc5ef291e8..a59d269826 100644 --- a/plugins/hr-resources/src/components/ScheduleRequests.svelte +++ b/plugins/hr-resources/src/components/ScheduleRequests.svelte @@ -38,7 +38,10 @@ function getStyle (type: RequestType, request: Request): string { let res = `background-color: ${ - isWeekend(date) && noWeekendHolidayType.includes(type._id) ? getPlatformColor(16) : getPlatformColor(type.color) + (isWeekend(date) || isHoliday(getHolidayDatesForEmployee(staffDepartmentMap, employee._id, holidays), date)) && + noWeekendHolidayType.includes(type._id) + ? getPlatformColor(16) + : getPlatformColor(type.color) };` if (Math.abs(type.value % 1) === 0.5) { res += ' height: 50%;' @@ -60,7 +63,7 @@ <div class="w-full h-full relative p-1 flex"> {#each requests as request} {#await getType(request) then type} - {#if type && !((isWeekend(date) || isHoliday(getHolidayDatesForEmployee(staffDepartmentMap, employee._id, holidays), date)) && noWeekendHolidayType.includes(type._id))} + {#if type} <!-- svelte-ignore a11y-click-events-have-key-events --> <div class="request flex-center"