|
|
@@ -45,20 +45,19 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ staffs, companyHolida |
|
|
|
], |
|
|
|
[t] |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const holidayList: String[] = [...getPublicHolidaysForNYears(1, 2023).map((item) => dayjs(item.date).format("DD/MM/YYYY")), ...companyHolidays] |
|
|
|
const uniqueHoliday = holidayList.filter((value, index, arr) => index === arr.indexOf(value)); |
|
|
|
console.log(uniqueHoliday) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
|
<SearchBox |
|
|
|
formType={"download"} |
|
|
|
criteria={searchCriteria} |
|
|
|
onSearch={async (query: any) => { |
|
|
|
|
|
|
|
console.log(query); |
|
|
|
const yearNeeded = parseInt(dayjs(query.date).format("YYYY")) |
|
|
|
const holidayList: String[] = [...getPublicHolidaysForNYears(1, yearNeeded).map((item) => dayjs(item.date).format("DD/MM/YYYY")), ...companyHolidays] |
|
|
|
const uniqueHoliday = holidayList.filter((value, index, arr) => index === arr.indexOf(value)); |
|
|
|
|
|
|
|
let postData = { |
|
|
|
id: query.staff, |
|
|
|
yearMonth: dayjs().format("YYYY-MM").toString(), |
|
|
@@ -78,7 +77,7 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ staffs, companyHolida |
|
|
|
} |
|
|
|
}} |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|