|
|
@@ -36,7 +36,6 @@ interface Props<EntryTableProps = object> { |
|
|
|
EntryTableProps & { day: string; isHoliday: boolean } |
|
|
|
>; |
|
|
|
entryTableProps: EntryTableProps; |
|
|
|
isSaturdayWorker: boolean |
|
|
|
} |
|
|
|
|
|
|
|
function DateHoursTable<EntryTableProps>({ |
|
|
@@ -46,9 +45,9 @@ function DateHoursTable<EntryTableProps>({ |
|
|
|
leaveEntries, |
|
|
|
timesheetEntries, |
|
|
|
companyHolidays, |
|
|
|
isSaturdayWorker, |
|
|
|
}: Props<EntryTableProps>) { |
|
|
|
const { t } = useTranslation("home"); |
|
|
|
|
|
|
|
return ( |
|
|
|
<TableContainer sx={{ maxHeight: 400 }}> |
|
|
|
<Table stickyHeader> |
|
|
@@ -72,7 +71,6 @@ function DateHoursTable<EntryTableProps>({ |
|
|
|
timesheetEntries={timesheetEntries} |
|
|
|
EntryTableComponent={EntryTableComponent} |
|
|
|
entryTableProps={entryTableProps} |
|
|
|
isSaturdayWorker={isSaturdayWorker} |
|
|
|
/> |
|
|
|
); |
|
|
|
})} |
|
|
@@ -89,7 +87,6 @@ function DayRow<EntryTableProps>({ |
|
|
|
entryTableProps, |
|
|
|
EntryTableComponent, |
|
|
|
companyHolidays, |
|
|
|
isSaturdayWorker, |
|
|
|
}: { |
|
|
|
day: string; |
|
|
|
companyHolidays: HolidaysResult[]; |
|
|
@@ -99,18 +96,16 @@ function DayRow<EntryTableProps>({ |
|
|
|
EntryTableProps & { day: string; isHoliday: boolean } |
|
|
|
>; |
|
|
|
entryTableProps: EntryTableProps; |
|
|
|
isSaturdayWorker: boolean |
|
|
|
}) { |
|
|
|
const { |
|
|
|
t, |
|
|
|
i18n: { language }, |
|
|
|
} = useTranslation("home"); |
|
|
|
const dayJsObj = dayjs(day); |
|
|
|
|
|
|
|
const [open, setOpen] = useState(false); |
|
|
|
|
|
|
|
const holiday = getHolidayForDate(day, companyHolidays); |
|
|
|
const isWeekend = !isSaturdayWorker ? dayJsObj.day() === 0 || dayJsObj.day() === 6 : dayJsObj.day() === 0; |
|
|
|
const isHoliday = holiday || isWeekend; |
|
|
|
const isHoliday = holiday || dayJsObj.day() === 0 || dayJsObj.day() === 6; |
|
|
|
|
|
|
|
const leaves = leaveEntries[day]; |
|
|
|
const leaveHours = |
|
|
|