|
|
@@ -1,7 +1,7 @@ |
|
|
import { getPublicHolidaysForNYears } from "@/app/utils/holidayUtils"; |
|
|
import { getPublicHolidaysForNYears } from "@/app/utils/holidayUtils"; |
|
|
import { HolidaysResult } from "../holidays"; |
|
|
import { HolidaysResult } from "../holidays"; |
|
|
import { LeaveEntry, RecordTimeLeaveInput, TimeEntry } from "./actions"; |
|
|
import { LeaveEntry, RecordTimeLeaveInput, TimeEntry } from "./actions"; |
|
|
import { convertDateArrayToString } from "@/app/utils/formatUtil"; |
|
|
|
|
|
|
|
|
import { INPUT_DATE_FORMAT, convertDateArrayToString } from "@/app/utils/formatUtil"; |
|
|
import compact from "lodash/compact"; |
|
|
import compact from "lodash/compact"; |
|
|
import dayjs, { Dayjs } from "dayjs"; |
|
|
import dayjs, { Dayjs } from "dayjs"; |
|
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter"; |
|
|
import isSameOrAfter from "dayjs/plugin/isSameOrAfter"; |
|
|
@@ -93,7 +93,7 @@ export const validateTimeLeaveRecord = ( |
|
|
const holidays = new Set( |
|
|
const holidays = new Set( |
|
|
compact([ |
|
|
compact([ |
|
|
...getPublicHolidaysForNYears(2).map((h) => h.date), |
|
|
...getPublicHolidaysForNYears(2).map((h) => h.date), |
|
|
...companyHolidays.map((h) => convertDateArrayToString(h.date)), |
|
|
|
|
|
|
|
|
...companyHolidays.map((h) => convertDateArrayToString(h.date, INPUT_DATE_FORMAT)), |
|
|
]), |
|
|
]), |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|