From 557b8713dd48908dae763ea3e73587a9b733f126 Mon Sep 17 00:00:00 2001 From: korospace Date: Mon, 30 Oct 2023 11:01:32 +0700 Subject: [PATCH] membuat rhf datepicker v2 --- .../src/components/hook-form/RHFDatePickerV2.tsx | 9 ++++++--- .../src/components/hook-form/RHFDatepicker.tsx | 1 + .../Components/DetailLabResultForm.tsx | 10 +++++----- .../Components/DetailLabResultList.tsx | 2 +- .../CaseManagement/LaboratoriumResult/Model/Types.ts | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/dashboard/src/components/hook-form/RHFDatePickerV2.tsx b/frontend/dashboard/src/components/hook-form/RHFDatePickerV2.tsx index ef1853be..2a243513 100644 --- a/frontend/dashboard/src/components/hook-form/RHFDatePickerV2.tsx +++ b/frontend/dashboard/src/components/hook-form/RHFDatePickerV2.tsx @@ -17,7 +17,7 @@ interface IProps { disabled?: boolean; } -export default function RHFDatePickerV2({ name, label, dateFormat, minDate, maxDate, disabled, ...other }: IProps) { +export default function RHFDatePicker({ name, label, dateFormat, minDate, maxDate, disabled, ...other }: IProps) { const { control } = useFormContext(); const { fullWidth } = other; @@ -32,13 +32,16 @@ export default function RHFDatePickerV2({ name, label, dateFormat, minDate, maxD field.onChange(date)} + onChange={(date)=> field.onChange(date)} inputFormat={dateFormat} value={field.value} mask={''} minDate={(minDate) ? new Date(minDate) : null} maxDate={(maxDate) ? new Date(maxDate) : null} - renderInput={(params) => } + renderInput={(params) => } /> {!!error && ( diff --git a/frontend/dashboard/src/components/hook-form/RHFDatepicker.tsx b/frontend/dashboard/src/components/hook-form/RHFDatepicker.tsx index 0b00d37c..1cb778bb 100644 --- a/frontend/dashboard/src/components/hook-form/RHFDatepicker.tsx +++ b/frontend/dashboard/src/components/hook-form/RHFDatepicker.tsx @@ -62,6 +62,7 @@ export default function RHFDatepicker({ name, ...other }: IProps & TextFieldProp value={field.value} inputFormat="dd/MMM/yyyy" // inputFormat="dd - MMM - yyyy" + mask='' onChange={(value) => { field.onChange(value); }} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultForm.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultForm.tsx index 7d6191dd..73f260e4 100644 --- a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultForm.tsx +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultForm.tsx @@ -43,7 +43,7 @@ export default function DetailMonitoringList() { id : '', claim_id : '', claim_code : '', - date : '', + date : null, location : '', examination : '', lab_result_file : [], @@ -119,11 +119,11 @@ export default function DetailMonitoringList() { - diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultList.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultList.tsx index 928df320..3d79403c 100644 --- a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultList.tsx +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/DetailLabResultList.tsx @@ -61,7 +61,7 @@ export default function DetailLabResultList() { {/* back button */} - navigate(`/case_management/daily_monitoring/${member_id}/claims`)} > + navigate(`/case_management/laboratorium_result/${member_id}/claims`)} > diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts index 8a4e3a8d..de83a151 100644 --- a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts @@ -45,7 +45,7 @@ export type DetailLabResultListType = { id : string|null, claim_id : string|null, claim_code : string, - date : string, + date : string|null, location : string, examination : string, lab_result_file : LabResultFileStrType[],