@lion/ui
Version:
A package of extendable web components
52 lines (42 loc) • 1.6 kB
Markdown
---
parts:
- Input Date
- Overview
title: 'Input Date: Overview'
eleventyNavigation:
key: 'Input Date: Overview'
order: 10
parent: Input Date
title: Overview
---
A web component based on the generic text input field. Its purpose is to provide a way for users to fill in a date.
```js script
import { html } from '@mdjs/mdjs-preview';
import { MinDate, MinMaxDate, MaxDate } from '@lion/ui/form-core.js';
import { loadDefaultFeedbackMessages } from '@lion/ui/validate-messages.js';
import { formatDate } from '@lion/ui/localize.js';
import '@lion/ui/define/lion-input-date.js';
```
```html preview-story
<lion-input-date label="Date" name="date"></lion-input-date>
```
- Based on our [input](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/components/input/overview.md)
- Makes use of [formatDate](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/localize/dates.md) for formatting and parsing.
- Option to override locale to change the formatting and parsing
- Default label in different languages
- Can make use of date specific [validators](https://github.com/ing-bank/lion/blob/5f1d7166273cc724458c0239822cd454e16253fa/docs/fundamentals/systems/form/validate.md) with corresponding error messages in different languages
- IsDate (default)
- MinDate
- MaxDate
- MinMaxDate
```bash
npm i --save @lion/ui
```
```js
import { LionInputDate } from '@lion/ui/input-date.js';
// or
import '@lion/ui/define/lion-input-date.js';
```