bluedogtraining/bdt-elm/22.0.1

NOTE: the latest version is 27.0.14

Time.Bdt

Time Helpers

Print Posix

toDateString : Posix -> String

Returns a string as dd/mm/yyyy

toTimeString : Posix -> String

Returns a string as hh:mm:ss

toDateTimeString : Posix -> String

Returns a string as dd/mm/yyyy hh:mm:ss

maybeToDateString : Maybe Posix -> String

Returns a string as dd/mm/yyyy. Defaults to --/--/----

maybeToTimeString : Maybe Posix -> String

Returns a string as hh:mm:ss. Defaults to 00:00:00

maybeToDateTimeString : Maybe Posix -> String

Returns a string as hh:mm:ss dd/mm/yyyy. Defaults to --/--/---- 00:00:00

Helpers

monthNumber : Month -> Int

Returns the Int representation of a month

monthString : Month -> String

Returns the String representation of a month

monthFromNumber : Int -> Month

Returns the Month based on it's number

addMonths : Int -> Posix -> Posix

Add months to a posix

clamp : Posix -> Posix -> Posix -> Posix

Clamp a posix

maybeClamp : Maybe Posix -> Maybe Posix -> Posix -> Posix

Clamp between maybe posix

Sort Times

order : Posix -> Posix -> Order

Orders 2 dates. This comes in handy with List.sortWith:

List.sortWith Time.order [ date1, date2, date3 ]

Encode/Decode Times

encode : Posix -> Value

Encode a Posix

encodeMaybe : Maybe Posix -> Value

Encode a Maybe Posix

decoder : Decoder Posix

Decode a Posix