rluiten/elm-date-extra/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

Date.Utils

Date Utils.

Date parsing

fromString : String -> Result String Date

Elm Date.fromString suffers from the some of the same javascript unusual compensation of input ranges when converting strings to Dates.

This method makes some known undesirable no Err results return Err.

Example produces Ok "2012-03-02" in javascript

  aDate = (Date.fromString "2012-02-31")

checkDateResult tries to catch and mark as Err some of these cases.

Be careful with unsafeFromString it will Debug.crash() if it cant parse date.

unsafeFromString : String -> Date

Utility for known input string date creation cases. Checks for a fail just in case and calls Debug.crash().

Utility

dayList : Int -> Date -> List Date

Return a list of days dayLength long for successive days starting from startDate.

isoWeek : Date -> ( Int, Int, Int )

Return iso week values year, week, isoDayOfWeek.

isoWeekOne : Int -> Date

Return date of start of week one for year.

Copyright (c) 2016 Robin Luiten