goilluminate/elm-fancy-daterangepicker/5.1.1

NOTE: the latest version is 7.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/goilluminate/elm-fancy-daterangepicker is gone (deleted or private); Software Heritage has not archived the repo; no fork with tag 5.1.1 found (2 same-name repos checked); no cached copy. Use another version.

Details

DateRangePicker

A customizable daterangepicker component.

type Msg

A type representing messages that are passed within the DateRangePicker.

The DateRangePicker model.

The default initial state of the DateRangePicker. You must execute the returned command in order to set the current date and for the daterangepicker to behave correctly.

The daterangepicker update function.

Subscribes to a mouse click

Expose if the daterange picker is open

Sets the the open state of the DateRangePicker

The daterange picker view. The date range passed is whatever date range it should treat as selected.

getDateRange : DateRangePicker -> Maybe DateRange

Expose the current selected daterange.

Sets the current daterange for the daterangepicker.

Expose today's date.

Settings

type alias Settings =
{ placeholder : String
, inputName : Maybe String
, inputId : Maybe String
, inputIcon : Maybe (Html Msg)
, inputAttributes : List (Attribute Msg)
, presetOptions : PresetOptions
, restrictedDateRange : RestrictedDateRange
, formatDateRange : DateRange -> String
, calendarDisplay : CalendarDisplay
, inputView : Maybe (String -> List (Html Msg))
, showPresetsTab : Bool
}

The settings that the DateRangePicker uses.

defaultSettings : Settings

A record of default settings for the daterangepicker.

Sets the settings for the daterange picker

setDateRangeFormat : (DateRange -> String) -> DateRangePicker -> DateRangePicker

Sets the date range formatter for the daterangepicker.

Sets the placeholder for the daterangepicker.

Sets the name for the daterangepicker.

Sets the inputText for the daterangepicker.

Sets the id for the daterangepicker.

Sets the input icon for the daterangepicker.

Sets the input attributes for the daterangepicker.

Sets the preset options for the daterangepicker.

Sets the restricted date range for the daterangepicker.

formatDateRange : DateRange -> String

A function that formats a daterange to a string.

getMinDate : DateRangePicker -> Maybe Date

Expose the min date in the enabled date range.

getMaxDate : DateRangePicker -> Maybe Date

Expose the max date in the enabled date range.

Sets the CalendarDisplay for the daterangepicker

Maybe (String -> List (Html Msg))

Sets the inputView function for the daterangepicker

Sets the showPresetsTab option for the daterangepicker

Presets

type alias PresetOptions =
{ presetOption : PresetOption
, presetSettings : List PresetSetting
, presets : List Preset
}

A type representing your preset options for your date range picker.

= DefaultPresets
| CustomPresetsFromSettings
| CustomPresets
| CustomOnly
| AllPresets
| NoPresets

A type representing which presets to use.

  • DefaultPresets = Use the default presets from defaultPresets only.
  • CustomPresetsFromSettings = Use only your custom built presets from a list of PresetSetting only.
  • CustomPresets = Use only your custom built Presets.
  • CustomOnly = Use only your custom build presets build from PresetSetting and your custom presets.
  • AllPresets = Use all presets (default, customFromSettings, custom).
  • NoPresets = Turn off Presets.
type alias Preset =
{ name : String
, dateRange : DateRange
}

A type that represents a preset daterange.

  • name = Name of the preset. i.e. "Past Month"
  • dateRange = The daterange that is selected when selecting the preset.
type alias PresetSetting =
{ name : String
, interval : PresetInterval
, presetRelativeToToday : PresetRelativeToToday
, value : Int
}

A type used to generate preset dateranges.

  • name = The name that you want to give the preset. i.e. "Past Month"
  • interval = The interval in which you want to add/subtract the value from today.
  • presetRelativeToToday = whether it is a range from [past - present] (ToToday) or [present - future] (FromToday)
  • value = the number of your @interval that you are adding/subtracting.

Example

{ name = "Past Month"
, interval = Months
, presetRelativeToday = ToToday
, value = 1
}
= Days
| Months
| Years

A type representing what the value in PresetSettings is measured in.

  • Ex. value = 1 and PresetInterval = Days, this is interpretted as 1 Days.
  • Ex. value = 4 and PresetI:nterval = Months, this is interpretted as 4 Months.
= ToToday
| FromToday

A type representing how the preset is relative to today.

  • If using ToToday, the preset daterange would use today as the end date, and the date from your PresetSettings as the end date.
  • If using FromToday, the preset daterange would use today as the start date and the date from your PresetSettings as the end date.
defaultPresetOptions : PresetOptions

A record of default preset options for the daterangepicker.

defaultPresets : Date -> List Preset

An opaque function used to make the default presets

mkPresetFromDateRange : String -> DateRange -> Preset

A function that creates a Preset from a name and a dateRange

mkPresetFromDates : String -> Date -> Date -> Preset

A function that creates a Preset from a name, startDate, and endDate

getPresets : DateRangePicker -> List Preset

Expose the current presets.