bluedogtraining/bdt-elm/27.0.3

NOTE: the latest version is 27.0.14

Time.Bdt

Time Helpers

Print Posix

toDateString : Zone -> Posix -> String

Returns a string as dd/mm/yyyy

toTimeString : Zone -> Posix -> String

Returns a string as hh:mm:ss

toDateTimeString : Zone -> Posix -> String

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

maybeToDateString : Zone -> Maybe Posix -> String

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

maybeToTimeString : Zone -> Maybe Posix -> String

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

maybeToDateTimeString : Zone -> 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 : Zone -> 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

Setters

setDay : Zone -> Int -> Posix -> Posix

Set the day of the month for 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