adius/vectual/4.0.0

NOTE: the latest version is 6.0.0

Renamed to ad-si/Vectual. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as adius/vectual still install under that name. 3 versions of 7 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/ad-si/Vectual.

What we checked: The repo moved to github.com/ad-si/Vectual and tag 4.0.0 is there; its commit 0d3f2db59855 is from 2021-02-13 17:06 UTC, before the version was published (2021-02-13 17:07 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/adius/vectual/zipball/4.0.0/

TimeUtils.Period

Period is a fixed length of time. It is an elapsed time concept, which does not include the concept of Years Months or Daylight saving variations.

  • Represents a fixed (and calendar-independent) length of time.

Name of type concept copied from NodaTime.

add : Period -> Int -> Posix -> Posix

Add Period count to date.

diff : Posix -> Posix -> PeriodDeltaRecord

Return a Period representing date difference. date1 - date2. If you add the result of this function to date2 with addend of 1 will return date1.

type Period
= Millisecond
| Second
| Minute
| Hour
| Day
| Week
| Delta PeriodDeltaRecord

A Period.

Week is a convenience for users if they want to use it, it does just scale Day in functionality so is not strictly required.

PeriodDeltaRecord values are multiplied addend on application.

type alias PeriodDeltaRecord =
{ week : Int
, day : Int
, hour : Int
, minute : Int
, second : Int
, millisecond : Int
}

A multi granularity period delta.

zeroDelta : PeriodDeltaRecord

All zero delta. Useful as a starting point if you want to set a few fields only.

toTicks : Period -> Int

Return tick counts for periods. Useful to get total ticks in a Delta.

addTimeUnit : Int -> Int -> Posix -> Posix

Add time units.