Uncaught TypeError date.locale is not a function
I am using ant design
TimePicker
component on my form. While creating a form it doesn't have a problem but when I am trying to edit and click on edit icon then my edit page crashes with the above mentioned error. My detail page response from API is:
And I get the start_time
and end_time
as string, which TimePicker
component cannot convert to dayjs. What can I do to make it work?1 Reply
graceful-blue•3y ago
Hi @dipbazz,
You can use
getValueProps
to convert your value to a DatePicker compatible type like this:
https://github.com/refinedev/refine/blob/next/examples/inputs/datePicker/src/pages/posts/edit.tsx#L82-L84GitHub
refine/edit.tsx at next · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/edit.tsx at next · refinedev/refine