adius/vectual/5.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 5.0.0 is there; its commit 14ae04e1bb14 is from 2023-09-18 14:03 UTC, before the version was published (2023-09-18 14:04 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/5.0.0/

TimeUtils.Field

Setting a date field on a date.

fieldToDate : Field -> Posix -> Maybe Posix

Set a field on a date to a specific value.

If your value in field is out side of valid range for the date field this function will return Nothing.

  • DayOfWeek cannot be invalid input range
  • Month cannot be invalid

Valid ranges

  • Millisecond 0 to 999
  • Second 0 to 59
  • Minute 0 to 59
  • Hour 0 to 23
  • DayOfMonth 1 to max day of month for year
  • Year >= 0
fieldToDateClamp : Field -> Posix -> Posix

Set a field on a date to a specific value.

This version clamps any input Field values to valid ranges as described in the doc for fieldToDate function.

type Field
= Millisecond Int
| Second Int
| Minute Int
| Hour Int
| DayOfWeek ( Weekday, Weekday )
| DayOfMonth Int
| Month Month
| Year Int

Configured Field and Value to set on date.

All field values are applied Modulus there maximum value.

  • DayOfWeek
    • The week keeps the same start of week day as passed in and changes day.
  • Month
    • Will not change year only the month of year.
fieldToString : Field -> String