flo-ham/date-picker/1.0.0

DateRangePicker.Range

Date range management.

Range

type Range

A time range between two Time.Posix.

create : Zone -> Posix -> Posix -> Range

Creates a Range from two Posix timestamps.

Note: Posix args order is not important as it's internally managed.

beginsAt : Range -> Posix

Retrieves the Posix the Range begins at.

endsAt : Range -> Posix

Retrieves the Posix the Range ends at.

Helpers

between : Posix -> Range -> Bool

Checks if a Time.Posix is comprised within a Range.

days : Range -> Int

Computes the number of days in a Range, floored.

format : Translations -> Zone -> Range -> String

Formats a Range in simple fashion.

Conversion

decode : Decoder Range

Decodes a Range from JSON.

encode : Range -> Value

Encodes a Range to JSON.

fromString : String -> Maybe Range

Extract a Range from a String, where the two Posix timestamps are encoded as UTC to Iso8601 format and joined with a ; character.

toString : Range -> String

Turns a Range into a String, where the two Posix timestamps are encoded as UTC to Iso8601 format and joined with a ; character.

toTuple : Range -> ( Posix, Posix )

Converts a Range into a Tuple.