--- title: 'Input Datepicker: Use Cases' parts: - Input Datepicker - Use Cases eleventyNavigation: key: 'Input Datepicker: Use Cases' order: 20 parent: Input Datepicker title: Use Cases --- # Input Datepicker: Use Cases ```js script import { html } from '@mdjs/mdjs-preview'; import { MinMaxDate, IsDateDisabled } 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-datepicker.js'; loadDefaultFeedbackMessages(); ``` ## Minimum and maximum date Below are examples of different validators for dates. ```js preview-story export const minimumAndMaximumDate = () => html`
Enter a date between ${formatDate(new Date('2018/05/24'))} and ${formatDate(new Date('2018/06/24'))}.
`; ``` ## Disable specific dates ```js preview-story export const disableSpecificDates = () => html` `; ``` ## Calendar heading You can modify the heading of the calendar with the `.calendarHeading` property or `calendar-heading` attribute for simple values. By default, it will take the label value. ```js preview-story export const calendarHeading = () => html` `; ``` ## Disabled You can disable datepicker inputs. ```js preview-story export const disabled = () => html` `; ``` ## Read only You can set datepicker inputs to `readonly`, which will prevent the user from opening the calendar popup. ```js preview-story export const readOnly = () => html` `; ``` ## Faulty prefilled Faulty prefilled input will be cleared ```js preview-story export const faultyPrefilled = () => html` `; ```