Feedback Laraform is now in maintenance mode. Read more on our GitHub.

Date Element

An element used to render date input using flatpickr.

#Examples

#Options

Name Type Description
mode string Flatpickr's mode option. Possible values: single, multiple or range.
format string Visisble format of the date using flatpickr's formatting tokens. Defaults to elements.date.format from locale.
dataFormat string Submittable format of the date using momentjs's formatting tokens. Defaults to elements.date.dataFormat from locale.
min string Earliest selectable date.
max string Latest selectable date.
disables array List of dates to be disabled.
disabled boolean Whether the field is disabled.
default string Value of element when the form is initially loaded or reseted.
placeholder string The placeholder of the element.
floating string The floating label of the element.
readonly boolean Whether the field is readonly.
options object Additional options for flatpickr.

#Properties

Name Type Default Description
disabled boolean false Whether the field is disabled.
mode string 'single' Flatpickr's mode option. Possible values: single, multiple or range.
format string - Visisble format of the date using flatpickr's formatting tokens. Defaults to elements.date.format from locale.
dataFormat string - Submittable format of the date using momentjs's formatting tokens. Defaults to elements.date.dataFormat from locale.
min string null Earliest selectable date.
max string null Latest selectable date.
disables array [] List of dates to be disabled.
defaultValue string null Value of element when the form is initially loaded or reseted.
placeholder string null The placeholder of the element.
floating string null The floating label of the element.
readonly boolean false Whether the form element is readonly.
options object {} Additional options for flatpickr.
datepicker$ object null The flatpickr component.

#Methods

# .disable()

Disabled the field.


# .enable()

Enables the field.


# .formatDate(date)

Parameters
  • date string : date to be formatted.

Formats a given date to the expected data format.