Closed thecassion closed 5 years ago
@thecassion Are you setting the locale prop and is this the error message you get (before the stack trace)?
RangeError: locale must contain localize property.
RangeError: locale must contain localize property.
I have this problem and cannot see the DatePicker at all. I tried to set prop locale="en-us" or import enLocale from 'date-fns/locale/en-US'; and then locale={enLocale}
but none of it worked for me.
This is problematic for us too.
I'll be able to take a look at this next week. Meanwhile if someone has a fix feel free to submit a PR.
On Mon, 13 Aug 2018, 22:39 Jeffry Evans, notifications@github.com wrote:
This is problematic for us too.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vascofg/react-admin-date-inputs/issues/11#issuecomment-412674071, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmuSd1L6iR-tSzskB0Q90fsTHbv6ZDaks5uQfH3gaJpZM4VvLVT .
Had the same issue.
I removed the tags Edit, TabbedForm and FormTab from the exemple and left the DateTimeInput (the only one I need).
const NewsEdit = props => { return ( <DateTimeInput source="startDate" label="Start date" options={{ format: 'DD/MM/YYYY HH:mm', ampm: true, clearable: true }} /> ); };
` export const MissionEdit = props => ( <Edit {...props}>
); `
Now it works for me.
creating a constant with just DateTimeInput and referencing it even inside a TabbedForm and FormTab worked also for me. Thank you @nadirberrara
I'm looking into this right now, in the meantime please use 1.0.16
This is fixed in 1.0.20
.
The problem was that the locale
prop already existed in react-admin, so, when not defined in the picker component, instead of being undefined
inside react-admin-date-inputs, it was receiving the value of the react-admin locale.
Anyway, please refer to the README.md for the new way to specify custom locales and util libs.