( ( (

@mui/x-date-pickers DatePicker Format Problem

58 Views Asked by At
<Controller
            name="loan_date"
            control={control}
            render={({ field }) => (
                <DatePicker
                    label="Loan Date"
                    inputFormat="YYYY/MM/DD"
                    value={field.value} // Assuming 'field.value' represents the date value
                    onChange={(date) => field.onChange(date)} // Assuming 'field.onChange' updates the value
                    renderInput={(params) => (
                        <TextField
                            {...params}
                            className="mt-8 mb-16"
                            error={!!errors.loan_date}
                            helperText={errors?.loan_date?.message}
                            id="loan_date"
                            variant="outlined"
                            fullWidth
                            InputLabelProps={{ shrink: true }}
                        />
                    )}
                />
            )}
        />

Need to be the date Format : 2024-03-22 but when get data show the invalid time error, Any solution?

0

There are 0 best solutions below