1.2.0 • Published 1 year ago

@arwinvdv/range-plugin v1.2.0

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
1 year ago

@arwinvdv/range-plugin

npm version

This package does not need to be installed if you are using @arwinvdv/bundle.

Adds the ability to select a range of dates.

Documentation

https://easepick.com/packages/range-plugin

Options

NameTypeDefaultDescription
elementEndHTMLElement stringnullBind the datepicker to a element for end date.
startDateDate string numbernullPreselect start date. Date Object or Unix Timestamp (with milliseconds) or String (must be equal to option format).
endDateDate string numbernullPreselect end date. Date Object or Unix Timestamp (with milliseconds) or String (must be equal to option format).
repickbooleanfalseIf date range is already selected, then user can change only one of start date or end date (depends on clicked field) instead of new date range.
strictbooleantrueDisabling the option allows you to select an incomplete range.
delimiterstring' - 'Delimiter between dates.
tooltipbooleantrueShowing tooltip with how much days will be selected.
tooltipNumberfunctionHandling the tooltip number.
localeobject{ one: 'day', other: 'days' }Text for the tooltip. Keys depends on option lang (see Intl.PluralRules).

Methods

NameDescription
setDateRange(start, end)Set date range. Should be Date Object or Unix Timestamp (with milliseconds) or String (must be equal to option format).
setStartDate(date)Set start of date range. Should be Date Object or Unix Timestamp (with milliseconds) or String (must be equal to option format).
setEndDate(date)Set end of date range. Should be Date Object or Unix Timestamp (with milliseconds) or String (must be equal to option format).
getStartDate()Return current start of date range as DateTime Object.
getEndDate()Return current end of date range as DateTime Object.