We updated the React DatePicker from 1.X to 3.X. The library no longer uses moment. Instead it uses DateFns as a dependency for date management. Therefore, the Date Input no longer uses moment object for the value, but a Javascript Date object. Also, the onChange callback return a Date value instead of a moment Value.
The locale
param also changed. It is a string which set the language of the component. You can find the full list on DateFns's website. This feature uses the dynamic import in order to import only the locales needed by the user. Be sure that your project is able to manage that with an approriate tool (like Webpack).
We also added a format
param which allow to specify the way to display value in viewvalue and in the field. He have to be a unicode format
In 1.X:
<DateInput
label="Enter a date"
locale="fr-fr"
value={moment('11/26/2017', 'MM/DD/YYYY')}
/>
In 2.0.x
<DateInput
label="Enter a date"
locale="fr"
value={new Date('11-26-2017')}
format="dd/MM/yyyyy"
/>
The component Title
(from @axa-fr/react-toolkit-layout-header
) has been renamed to HeaderTitle
to add @axa-fr/react-toolkit-title
to the @axa-fr/react-toolkit-all
package.
- import { Title } from '@axa-fr/react-toolkit-all';
+ import { HeaderTitle } from '@axa-fr/react-toolkit-all';