fitur is reversal

This commit is contained in:
2024-03-04 09:36:26 +07:00
parent ab65d53aca
commit 3bae411dc6
5 changed files with 155 additions and 93 deletions

View File

@@ -78,15 +78,13 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
);
const [date, setDate] = useState(currentClaim?.submission_date)
const [date, setDate] = useState(currentClaim?.submission_date ? fDateTimesecond(currentClaim?.submission_date) : null)
const id = currentClaim?.id
useEffect(() => {
setDate(currentClaim?.submission_date)
}, [currentClaim]);
console.log(date);
useEffect(() => {
if (isEdit && currentClaim) {
reset(defaultValues);
@@ -254,7 +252,6 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
</Stack>
)
return (
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
<Stack direction="row" alignItems="center" sx={{ mb: 5 }}>
@@ -310,10 +307,14 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
<RHFDateTimePicker
{...field}
label="Date of Submission"
value={field.value || null}
onChange={() => setDate(field.value)}
value={field.value}
onChange={() =>
setDate(field.value)
}
dateFormat='dd MMM yyyy HH:mm:ss'
/>
)}
/>
</Grid>
<Grid item xs={3}>