- @lion/button@0.4.0 - @lion/calendar@0.5.0 - @lion/dialog@0.2.3 - @lion/input-datepicker@0.6.0 - @lion/overlays@0.8.0 - @lion/popup@0.4.3 - @lion/select-rich@0.8.0 - @lion/switch@0.3.10 - @lion/tooltip@0.5.0 |
||
|---|---|---|
| .. | ||
| src | ||
| stories | ||
| test | ||
| test-helpers | ||
| translations | ||
| CHANGELOG.md | ||
| index.js | ||
| lion-input-datepicker.js | ||
| package.json | ||
| README.md | ||
| test-helpers.js | ||
Input Datepicker
lion-input-datepicker component is based on the date text input field. Its purpose is to provide a way for users to fill in a date with a datepicker.
For an input field with a big range, such as birthday-input, a datepicker is not the ultimate tool, so use the standard lion-input-date.
Features
- input field with a datepicker to help to choose a date
- based on lion-input-date
- makes use of lion-calendar inside the datepicker
- makes use of formatDate for formatting and parsing.
- option to overwrite locale to change the formatting and parsing
- can make use of date specific validators with corresponding error messages in different languages
- IsDate (default)
- MinDate
- MaxDate
- MinMaxDate
- IsDateDisabled
How to use
Installation
npm i --save @lion/input-datepicker
import '@lion/input-datepicker/lion-input-datepicker.js';
// validator import example
import { Required, MinDate } from '@lion/validate';
Example
<lion-input-datepicker
name="date"
.validators="${[new Required(), new MinDate(new Date('2018/05/24'))]}"
></lion-input-datepicker>