npm install --save @sb1/ffe-datepicker-react
Full documentation on datepicker usage is available at https://design.sparebank1.no/komponenter/skjemaelementer/#datepicker.
This package depends on @sb1/ffe-form-react
and @sb1/ffe-icons-react
.
Make sure you import the less-files from these packages.
i18nShow calendar on focusHandle various input-formats (see simpledate.test.js)- Validate on blur on the whole component (both the input and the calendar)
Requirements for full a11y-compliance:
Examples:
Evaluated implementations:
- Pickaday (or variants of it): Not a11y compliant. Lacks ARIA-roles and keyboard navigation
- http://jquense.github.io/react-widgets/docs/#/datetime-picker : Lacks keyboard navigation
- https://hacker0x01.github.io/react-datepicker/ : Lacks keyboard navigation
To start a local development server, run the following from the designsystem root folder:
npm install
npm run build
npm start
A local instance of component-overview
with live reloading will run at http://localhost:1234/.
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.