abadi199/datetimepicker/1.0.2

NOTE: this package is not compatible with Elm 0.19.1

DateTimePicker.Config

DateTimePicker configuration

Configuration

type alias Config otherConfig msg =
{ otherConfig
| onChange : State -> Maybe Date -> msg
, dateFormatter : Date -> String
, dateTimeFormatter : Date -> String
, autoClose : Bool
}

Configuration

* onChange is the message for when the selected value and internal State in the date picker has changed. * dateFormatter is a Date to string formatter used to display the date in the input text * dateTimeFormatter is a Date to string formatter used to display the date in the footer section. * autoClose is a flag to indicate whether the dialog should be automatically closed when a date and/or time is selected.

type alias DatePickerConfig otherConfig =
{ otherConfig
| nameOfDays : NameOfDays
, firstDayOfWeek : Day
, titleFormatter : Date -> String
, fullDateFormatter : Date -> String
}

Configuration for the DatePicker

* nameOfDays is the configuration for name of days in a week. * firstDayOfWeek is the first day of the week. * formatter is the Date to String formatter for the input value. * titleFormatter is the Date to String formatter for the dialog's title. * fullDateFormatter is the Date to String formatter for the dialog's footer.

type alias TimePickerConfig =
{ timeFormatter : Date -> String
, timePickerType : TimePickerType
}

Configuration for TimePicker

* timeFormatter is the time to String formatter. * timePickerType is the type of the time picker, either Analog or Digital

defaultDatePickerConfig : (State -> Maybe Date -> msg) -> Config (DatePickerConfig {}) msg

Default configuration for DatePicker

* onChange No Default * dateFormatter Default: "%m/%d/%Y" * dateTimeFormatter Default: "%m/%d/%Y %I:%M %p" * autoClose Default: True * nameOfDays see NameOfDays for the default values. * firstDayOfWeek Default: Sunday. * titleFormatter Default: "%B %Y" * fullDateFormatter Default: "%A, %B %d, %Y"

defaultTimePickerConfig : (State -> Maybe Date -> msg) -> Config TimePickerConfig msg

Default configuration for TimePicker * onChange No Default * dateFormatter Default: "%m/%d/%Y" * dateTimeFormatter Default: "%m/%d/%Y %I:%M %p" * autoClose Default: False * timeFormatter Default: "%I:%M %p" * timePickerType Default: Analog

(State -> Maybe Date -> msg)
-> Config (DatePickerConfig TimePickerConfig) msg

Default configuration for DateTimePicker

* onChange No Default * dateFormatter Default: "%m/%d/%Y" * dateTimeFormatter Default: "%m/%d/%Y %I:%M %p" * autoClose Default: False * nameOfDays see NameOfDays for the default values. * firstDayOfWeek Default: Sunday. * titleFormatter Default: "%B %Y" * fullDateFormatter Default: "%A, %B %d, %Y" * timeFormatter Default: "%I:%M %p" * timePickerType Default: Analog

type alias NameOfDays =
{ sunday : String
, monday : String
, tuesday : String
, wednesday : String
, thursday : String
, friday : String
, saturday : String
}

Configuration for name of days in a week.

This will be displayed as the calendar's header. Default: * sunday = "Su" * monday = "Mo" * tuesday = "Tu" * wednesday = "We" * thursday = "Th" * friday = "Fr" * saturday = "Sa"

= Digital
| Analog

The type of time picker, can be either Digital or Analog

type Type msg
= DateType (Config (DatePickerConfig {}) msg)
| DateTimeType (Config (DatePickerConfig TimePickerConfig) msg)
| TimeType (Config TimePickerConfig msg)

The type of picker (for Internal Use)