Skip to content

Commit

Permalink
TSK-1419: show greyed requests on holidays and weekends (#3121)
Browse files Browse the repository at this point in the history
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
  • Loading branch information
ThetaDR authored May 2, 2023
1 parent afea88f commit f893b2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/hr-resources/src/components/ScheduleRequests.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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%;'
Expand All @@ -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"
Expand Down

0 comments on commit f893b2c

Please sign in to comment.