rluiten/elm-date-extra/5.0.0

NOTE: this package is not compatible with Elm 0.19.1

Date.Extra.Duration

A Duration is a length of time that may vary with with calendar date and time. It can be used to modify a date.

When modify dates using Durations (Day | Month | Week | Year) this module compensates for day light saving hour variations to minimise the scenarios that cause the Hour field in the result to be different to the input date. It can't completely avoid the hour changing as some hours are not a real world date and hence will modify the hour more than the Duration modified.

This behaviour is modelled on momentjs so any observed behaviour that is not the same as momentjs should be raised as in issue.

Note adding or subtracting 24 * Hour units from a date may produce a different answer to adding or subtracting a Day if day light saving transitions occur as part of the date change.

add : Duration -> Int -> Date -> Date

Add duration * count to date.

= Millisecond
| Second
| Minute
| Hour
| Day
| Week
| Month
| Year

A Duration is time period that may vary with with calendar and time.

Using Duration adding 24 hours can produce different result to adding 1 day.

Copyright (c) 2016 Robin Luiten