mercurymedia/elm-datetime-picker/1.0.0

NOTE: the latest version is 12.0.1

DurationDatePicker

A date picker component for picking a datetime range.

Architecture

The opaque type representing a particular date picker instance.

Instantiates and returns a date picker.

view : Settings msg -> DatePicker -> Html msg

The date picker view. Simply pass it the configured settings and the date picker instance you wish to view.

subscriptions : (DatePicker -> msg) -> DatePicker -> Sub msg

Events external to the picker to which it is subscribed.

Settings

type alias Settings msg =
{ formattedDay : Weekday -> String
, formattedMonth : Month -> String
, today : Maybe Posix
, dayDisabled : Posix -> Bool
, internalMsg : DatePicker -> msg
, selectedMsg : Posix -> Posix -> msg
}

The type facilitating the configuration of the datepicker settings.

defaultSettings : MsgConfig msg -> Settings msg

A record of default settings for the date picker. Extend this if you want to further customize the date picker.

Requires a MsgConfig msg record to set the date picker's internal and external msg indicators

{ internalMsg : DatePicker -> msg
, externalMsg : Posix -> msg
}

Externally Triggered Actions

openPicker : Posix -> Maybe Posix -> Maybe Posix -> DatePicker -> DatePicker

Open the provided date picker and receive the updated picker instance. Also takes a default time the picker should center on (in the event a time has not yet been picked) as well as the picked start and end times. A common example of a default time would be the datetime for the current day.

Close the provided date picker and receive the updated picker instance.