Hi,
The "jimu-ui/date-picker" component returns incorrect value to onChange event handler.
Maybe its related to locale, as I use "cs" (Czech) locale in my environment.
The value returned is 1 month plus the date selected from the calendar UI.
It seems the "jimu-ui/date-picker" is just a wrapper around the "react-datepicker" component to give it UI/UX consistency with other ExB components.
If this is true, then the "jimu-ui/date-picker" should have the same API as the "react-datepicker", but it has not (selected vs startDate prop, different value from onChange event, and more).
Here is an example of both components:
Both components render the date correctly. However, only the React DatePicker returns correct date from the onChange event.
ExB DatePicker returns a number as value from the onChange event, and this is 1 month plus the date selected from the calendar.
React DatePicker returns a date as value from the onChange event and the date is correct.
It would be nice to have more documentation for the Jimu UI components in the ExB SDK (examples of usage and overall API of components). I am aware of the Theme Builder page (Theme Builder), but its not sufficient to use as the reference.
Thanks,
Matej
Solved! Go to Solution.
We fixed this component to return the correct date. It will available in 1.1 dev edition of ExB. Thanks for the feedback regarding the UI components, we will add that one to our list when we update our documentation for 1.1 release.
Thanks,
David
We fixed this component to return the correct date. It will available in 1.1 dev edition of ExB. Thanks for the feedback regarding the UI components, we will add that one to our list when we update our documentation for 1.1 release.
Thanks,
David