| @@ -45,20 +45,19 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ staffs, companyHolida | |||||
| ], | ], | ||||
| [t] | [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 ( | return ( | ||||
| <> | <> | ||||
| <SearchBox | <SearchBox | ||||
| formType={"download"} | formType={"download"} | ||||
| criteria={searchCriteria} | criteria={searchCriteria} | ||||
| onSearch={async (query: any) => { | onSearch={async (query: any) => { | ||||
| console.log(query); | 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 = { | let postData = { | ||||
| id: query.staff, | id: query.staff, | ||||
| yearMonth: dayjs().format("YYYY-MM").toString(), | yearMonth: dayjs().format("YYYY-MM").toString(), | ||||
| @@ -78,7 +77,7 @@ const GenerateMonthlyWorkHoursReport: React.FC<Props> = ({ staffs, companyHolida | |||||
| } | } | ||||
| }} | }} | ||||
| /> | /> | ||||
| </> | |||||
| </> | |||||
| ); | ); | ||||
| }; | }; | ||||