@lion/input-datepicker

Provide a way for users to fill in a date via a calendar overlay

Usage no npm install needed!

<script type="module">
  import lionInputDatepicker from 'https://cdn.skypack.dev/@lion/input-datepicker';
</script>

README

Inputs >> Input Datepicker >> Overview ||10

A web component 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 best choice due to the high variance between possible inputs. We encourage using our standard input-date for this.

import { html } from '@mdjs/mdjs-preview';
import '@lion/input-datepicker/define';
export const main = () => {
  return html` <lion-input-datepicker label="Date" name="date"></lion-input-datepicker> `;
};

Features

  • Input field with a datepicker to help to choose a date
  • Based on our input-date
  • Makes use of our 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

Installation

npm i --save @lion/input-datepicker
import { LionInputDatepicker } from '@lion/input-datepicker';
// or
import '@lion/input-datepicker/define';