|
|
@@ -56,6 +56,8 @@ const EditStaffWrapper: React.FC<Props> & SubComponents = async ({ |
|
|
|
salary: SalaryCombo.records, |
|
|
|
} |
|
|
|
|
|
|
|
Staff.data.joinDate = Staff.data.joinDate && dateArrayToString(Staff.data.joinDate) as string |
|
|
|
Staff.data.departDate = Staff.data.departDate && dateArrayToString(Staff.data.departDate) as string |
|
|
|
// [{id:0, salaryPoint: 1, date:"2021-05-05"}, {id:1, salaryPoint: 43, date:"2024-05-05"}] |
|
|
|
console.log(Staff.data) |
|
|
|
|
|
|
@@ -65,3 +67,17 @@ console.log(Staff.data) |
|
|
|
EditStaffWrapper.Loading = EditStaffLoading; |
|
|
|
|
|
|
|
export default EditStaffWrapper; |
|
|
|
|
|
|
|
|
|
|
|
function dateArrayToString(dateArray: number[] | string): string { |
|
|
|
if (typeof dateArray === 'string'){ |
|
|
|
return dateArray |
|
|
|
} |
|
|
|
const [year, month, day] = dateArray; |
|
|
|
console.log(dateArray) |
|
|
|
// Ensure the month is in the correct range (0-11) |
|
|
|
const monthIndex = month; |
|
|
|
|
|
|
|
// Create the date string in the format "YYYY-MM-DD" |
|
|
|
return `${year}-${monthIndex.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`; |
|
|
|
} |