PanagiotisGeorgiadis/elm-datepicker/4.0.0

DatePicker.Types

Contains types that are being used by the parent application in order to initialise a DatePicker.

Types

= Single
| Double

The Calendar ViewTypes.

type alias CalendarConfig =
{ today : DateTime
, startingWeekday : Weekday
, primaryDate : Maybe DateTime
, dateLimit : DateLimit
}

Used in order to configure the Calendar part of the DatePicker.

  • 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.

    • If the primaryDate is set to Nothing the DatePicker will set the primaryDate equal to the today property.

    • If the consumer has provided both a primaryDate and a dateLimit but the primaryDate is out of bounds, the DatePicker will set the primaryDate equal to the minium date of the constrains.

  • dateLimit: Used to impose date restrictions on the DatePicker. The different configuration settings can be seen on the DateLimit definition.

= DateLimit
{ minDate : DateTime
, maxDate : DateTime
}
| NoLimit

The optional DatePicker 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
type alias TimePickerConfig =
{ pickerType : PickerType
, defaultTime : Time
, pickerTitle : String
}

Used in order to configure the TimePicker part of the DatePicker.

  • 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.

  • pickerTitle: Defines the TimePicker title.