Contains types that are being used by the parent application in order to initialise
a DateRangePicker
.
The Calendar ViewTypes.
{ today : DateTime
, startingWeekday : Time.Weekday
, primaryDate : Maybe DateTime
, dateLimit : DateLimit
, dateRangeOffset : Maybe { minDateRangeLength : Basics.Int }
}
Used in order to configure the Calendar
part of the DateRangePicker
.
today
: Represents today as DateTime
provided by the parent application.
startingWeekday
: The starting weekday of the calendar.
primaryDate
: Represents the default month - year
calendar screen.
Nothing
the DateRangePicker
will
set the primaryDate equal to the today property.DateRangePicker
will set
the primaryDate equal to the minium date of the constrains.dateLimit
: Used to impose date restrictions on the DateRangePicker
.
The different configuration settings can be seen on the
DateLimit definition.
dateRangeOffset
: Used to set a minimum length on the selected date range.
This basically means that if we set a minimumDateRangeLength of 3, the user
will be able to select a minimum of 3 dates.
The optional DateRangePicker
date restrictions. You can cover most of the
date restriction cases with the type below. If by any change you need to achieve
a case which is not possible by the current implementation please raise an issue
on the repository of this package.
-- A Custom imposed restriction for the year 2019
-- inclusive of the minDate and maxDate.
DateLimit { minDate = 1 Jan 2019, maxDate = 31 Dec 2019 }
-- An unlimited Calendar.
NoLimit
{ pickerType : TimePicker.Types.PickerType
, defaultTime : Clock.Time
, mirrorTimes : Basics.Bool
, i18n : I18n
}
Used in order to configure the TimePicker
part of the DateRangePicker
.
pickerType
: Defines the type of the picker as described in the TimePicker module.
defaultTime
: Defines the defaultTime that will be used as the default value of the TimePicker
.
mirrorTimes
: Dictates if both the TimePickers
should be in sync.
Note: The synchronisation takes place using the
onBlur
event of the input.
i18n: The TimePicker I18n
config
{ start : String
, end : String
, checkboxText : String
}
The TimePicker I18n
config
mirrorTimes
checkbox text