exotic-emerald
exotic-emerald5mo ago

How Can I change the date format?

<LocalizationProvider dateAdapter={AdapterDayjs}>
<Grid container spacing={2}>
<Grid item xs={2} sm={2}>
<DatePicker
{...register('start_date')}
label="주문 시작일"
value={startValue}
name="start_date"
onChange={(value) => {
setStartValue(value)}}
slotProps={{ textField: { size: 'small' } }}
/>
</Grid>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<Grid container spacing={2}>
<Grid item xs={2} sm={2}>
<DatePicker
{...register('start_date')}
label="주문 시작일"
value={startValue}
name="start_date"
onChange={(value) => {
setStartValue(value)}}
slotProps={{ textField: { size: 'small' } }}
/>
</Grid>
I want YYYY-MM-DD format.
2 Replies
kapa.ai
kapa.ai5mo ago
Hi @florent. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the information extracts provided do not contain the specific details on how to change the date format in Refine using the DatePicker component. However, Refine uses Day.js for date operations and formatting, as mentioned in the DateField documentation (https://refine.dev/docs/ui-integrations/ant-design/components/fields/date-field). You might want to refer to the Day.js documentation (https://day.js.org/docs/en/display/format) for more information on how to format dates. Please note that the code you provided seems to be using Material-UI's DatePicker, which is not directly related to Refine or Ant Design. You might want to refer to the respective library's documentation for more specific instructions. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@1184365192482652173> kapa.ai is still learning and improving, please let us know how it did by reacting below