TSK-1419: show greyed requests on holidays and weekends (#3121)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-05-02 21:30:15 +05:00 committed by GitHub
parent afea88fc3b
commit f893b2c1e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"