finos/morphir-elm/17.0.0

NOTE: the latest version is 22.0.2

Formerly Morgan-Stanley/morphir-elm. Search finds this package by either name.

Morphir.SDK.LocalDate

This module adds the definition of a date without time zones. Useful in business modeling.

Types

type alias LocalDate =
Date

Concept of a date without time zones.

Date Math

diffInDays : LocalDate -> LocalDate -> Int

Find the number of days between the given dates.

diffInWeeks : LocalDate -> LocalDate -> Int

Find the number of weeks between the given dates.

diffInMonths : LocalDate -> LocalDate -> Int

Find the number of months between the given dates.

diffInYears : LocalDate -> LocalDate -> Int

Find the number of years between the given dates.

addDays : Int -> LocalDate -> LocalDate

Add the given days to a given date.

addWeeks : Int -> LocalDate -> LocalDate

Add the given weeks to a given date.

addMonths : Int -> LocalDate -> LocalDate

Add the given months to a given date.

addYears : Int -> LocalDate -> LocalDate

Add the given years to a given date.

Constructors

fromISO : String -> Maybe LocalDate

Construct a LocalDate based on ISO formatted string. Opportunity for error denoted by Maybe return type.

fromParts : Int -> Int -> Int -> Maybe LocalDate

Construct a LocalDate based on Year, Month, Day. Opportunity for error denoted by Maybe return type. Errors can occur when any of the given values fall outside of their relevant constraints. For example, the date given as 2000 2 30 (2000-Feb-30) would fail because the day of the 30th is impossible.