Package-level declarations

Types

Link copied to clipboard
abstract external class DateMetadataController

A reactive controller that resolves the metadata (currently the disabled state) for the dates shown by the date-picker's dateMetadataProvider.

Link copied to clipboard

Attribute names of <vaadin-date-picker>, for use with setAttribute.

Link copied to clipboard
external interface DatePickerDate

A calendar date as understood by the date picker helpers.

Link copied to clipboard
external interface DatePickerDateMetadata

Metadata for a single date, returned by a DatePickerDateMetadataProvider.

Link copied to clipboard

Loads metadata for the given date range.

Link copied to clipboard
external interface DatePickerDateRange

A range of dates the calendar is about to render, always covering whole months.

Link copied to clipboard

<vaadin-date-picker> is an input field that allows to enter a date by typing or by selecting from a calendar overlay.

Link copied to clipboard

Typed event names of <vaadin-date-picker>, for use with addEventHandler.

Link copied to clipboard

The values exported by @vaadin/date-picker/src/vaadin-date-picker-mixin.js.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external interface MonthCalendarMixin : FocusMixin

Functions

Link copied to clipboard
external fun createDate(year: Double, month: Double, day: Double): Date

Create a date at midnight in local time. Unlike new Date(year, month, day), this supports years below 100, which the constructor maps into the 20th century. The month is assigned before the day so that the initial day of month (1) always exists in the target month.

Link copied to clipboard

Creates a <vaadin-date-picker> element. The custom element is registered on first use.

Link copied to clipboard
external fun dateAfterXMonths(months: Double): Double

Get difference in months between today and given months value.

Link copied to clipboard
external fun dateAllowed(date: Date, min: Date, max: Date, isDateDisabled: (DatePickerDate) -> Boolean): Boolean

Check if the given date is in the range of allowed dates.

Link copied to clipboard
external fun dateEquals(date1: Date, date2: Date, normalizer: (Date) -> Date = definedExternally): Boolean

Check if two dates are equal.

Link copied to clipboard

The class registered by @vaadin/date-picker/src/vaadin-date-metadata-controller.js.

Link copied to clipboard
external fun dateSelectable(date: Date, min: Date?, max: Date?, isDateDisabled: (DatePickerDate) -> Boolean, controller: DateMetadataController? = definedExternally): Boolean

Check if the given date can be selected: allowed by dateAllowed and not reported as disabled by the date metadata controller. This is narrower than dateAllowed, which decides what can be focused: a disabled date is still focusable, it just cannot be selected.

Link copied to clipboard
external fun extractDateParts(date: Date): JsAny

Extracts the basic component parts of a date (day, month and year) to the expected format.

Link copied to clipboard
external fun firstOfMonth(date: Date): Date

Get the first day of the month the given date is in.

Link copied to clipboard
external fun formatISODate(date: Date): String

Format a date instance in ISO 8601 ("YYYY-MM-DD") or 6-digit extended ISO 8601 ("+YYYYYY-MM-DD", "-YYYYYY-MM-DD") format.

Link copied to clipboard
external fun formatUTCISODate(date: Date): String

Format a date instance in ISO 8601 ("YYYY-MM-DD") or 6-digit extended ISO 8601 ("+YYYYYY-MM-DD", "-YYYYYY-MM-DD") format.

Link copied to clipboard
external fun getAdjustedYear(referenceDate: Date, year: Double, month: Double = definedExternally, day: Double = definedExternally): Double

Calculate the year of the date based on the provided reference date. Gets a two-digit year and returns a full year.

Link copied to clipboard
external fun getClosestDate(date: Date, dates: Array<Date>): Date

Get closest date from array of dates.

Link copied to clipboard
external fun getISOWeekNumber(date: Date): Double

Get ISO 8601 week number for the given date.

Link copied to clipboard
external fun lastOfMonth(date: Date): Date

Get the last day of the month the given date is in.

Link copied to clipboard
external fun monthDate(index: Double): Date

Get the first day of the month with the given index, inverting monthIndexOf. Counting from January of year 0 also inverts negative indexes, since createDate normalizes a month outside 0-11 into the year.

Link copied to clipboard
external fun monthIndex(date: Date): Double

Get the index of the month the given date is in.

Link copied to clipboard
external fun monthIndexOf(year: Double, month: Double): Double

Get the index of a month, counted from January of year 0. Reduces a month to a single integer, so a lookup builds no key and two months are adjacent when their indexes are.

Link copied to clipboard
external fun normalizeDate(date: Date): Date

Creates a new object with the same date, but sets the hours, minutes, seconds and milliseconds to 0.

Link copied to clipboard
external fun normalizeUTCDate(date: Date): Date

Creates a new object with the same date, but sets the hours, minutes, seconds and milliseconds to 0.

Link copied to clipboard
external fun parseDate(str: String): Date

Parse date string of one of the following date formats:

Link copied to clipboard
external fun parseUTCDate(str: String): Date

Parse date string of one of the following date formats:

Link copied to clipboard

Imports @vaadin/date-picker/src/vaadin-date-picker.js, registering <vaadin-date-picker>, and returns the element class.