Date Utils.
Create a date in current time zone from given fields. All field values are clamped to there allowed range values. This can only return dates in current time zone.
Hours are input in 24 hour time range 0 to 23 valid.
Create a time in current time zone from given fields, for when you dont care about the date part but need time part anyway.
All field values are clamped to there allowed range values. This can only return dates in current time zone.
Hours are input in 24 hour time range 0 to 23 valid.
This defaults to year 1970, month Jan, day of month 1 for date part.
Be careful with unsafeFromString it will Debug.crash() if it cant parse date.
Utility for known input string date creation cases. Checks for a fail just in case and calls Debug.crash().
Return a list of days dayLength long for successive days starting from startDate.
Return iso week values year, week, isoDayOfWeek.
Return date of start of week one for year.
Copyright (c) 2016 Robin Luiten
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 javascriptcheckDateResult tries to catch and mark as Err some of these cases.