1.0.2 • Published 2 years ago

@lucasz/d-datepicker v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

DDatepicker

Usage

  1. Import the component

import DDatepicker from 'd-datepicker';

  1. Add it to the components object

components: {DDatepicker}

  1. Use it in the template
<DDatepicker
  ...props
/>

Props

NameTypeRequiredValuesDescription
idAttrString-The id of the input element.
nameAttrString-The name of the input element.
classAttrString-The class of the input element.
placeholderAttrString-The placeholder of the input element.
currentDateDateDefault value: new Date()The currently selected date.
minDateDateDefault value: nullRestriction for the minimum date. Dates earlier than this date cannot be picked from.
maxDateDateDefault value: nullRestriction for the maximum date. Dates later than this date cannot be picked from.
leftArrowIconString-The icon for selecting the previous month.
rightArrowIconString-The icon for selecting the next month.
arrowIconAltString-The alt value for both arrow icons.
localeObject<{weekday: String[], todayBtn: String, clearBtn: String, closeBtn: String}>Default value: { weekday: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], todayBtn: "Today", clearBtn: "Clear", closeBtn: "Close", }Represents the strings to be used for the weekdays and buttons, this adds the possibility to use several languages.
inputDividerSymbolStringDefault value: / ---Possible values:/, -The divider symbol that is shown inside the input field, and used to parse the date from the input field.
inputFormatBooleanDefault value: DD_MM_YY ---Possible values: DD_MM_YY, MM_DD_YY, YY_MM_DDThe format of the date, so the order of day, month and year.
swipingEnabledBooleanDefault value: falseThe ability to switch between months with swiping movements, for mobile users.
hasDateRangeBooleanDefault value: falseThis enables the ability to select a range of dates. When this is enabled, the user needs to select 2 dates to specify the range. When the second date is selected, there is an event fired which returns two dates to indicate the range.

Events

NameDescription
value-changedFires when a date has been selected. Returns a Date and with hasDateRange enabled it returns two dates when the second date is selected(Date, Date).