Module

JS.Temporal.PlainYearMonth

Package
purescript-js-temporal
Repository
pete-murphy/purescript-js-temporal

A year and month without day or time zone. Use for month-level values (e.g. "January 2024"). Requires a reference day for some operations.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth

#new Source

new :: Int -> Int -> Effect PlainYearMonth

Creates a PlainYearMonth from year and month.

#from Source

from :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> String -> Effect PlainYearMonth

Parses a year-month string (e.g. "2024-01"). Options: overflow.

#from_ Source

from_ :: String -> Effect PlainYearMonth

Same as from with default options.

#add Source

add :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> Duration -> PlainYearMonth -> Effect PlainYearMonth

Adds a duration. Options: overflow.

#add_ Source

add_ :: Duration -> PlainYearMonth -> Effect PlainYearMonth

Same as add with default options.

#subtract Source

subtract :: forall provided. ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record provided) (Record OverflowOptions) => Record provided -> Duration -> PlainYearMonth -> Effect PlainYearMonth

Subtracts a duration. Options: overflow.

#subtract_ Source

subtract_ :: Duration -> PlainYearMonth -> Effect PlainYearMonth

Same as subtract with default options.

#with Source

with :: forall optsProvided fields rest. Union fields rest WithFields => ConvertOptionsWithDefaults ToOverflowOptions (Record OverflowOptions) (Record optsProvided) (Record OverflowOptions) => Record optsProvided -> Record fields -> PlainYearMonth -> Effect PlainYearMonth

Returns a new PlainYearMonth with specified fields replaced. Options: overflow.

#with_ Source

with_ :: forall fields rest. Union fields rest WithFields => Record fields -> PlainYearMonth -> Effect PlainYearMonth

Same as with with default options.

#toPlainDate Source

toPlainDate :: { day :: Int } -> PlainYearMonth -> Effect PlainDate

Converts to PlainDate by supplying a day.

#until Source

until :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainYearMonth -> PlainYearMonth -> Effect Duration

Duration from this year-month until the other.

#until_ Source

until_ :: PlainYearMonth -> PlainYearMonth -> Effect Duration

Same as until with default options.

#since Source

since :: forall provided. ConvertOptionsWithDefaults ToDifferenceOptions (Record DifferenceOptions) (Record provided) (Record DifferenceOptions) => Record provided -> PlainYearMonth -> PlainYearMonth -> Effect Duration

Duration from the other year-month to this one.

#since_ Source

since_ :: PlainYearMonth -> PlainYearMonth -> Effect Duration

Same as since with default options.

#toString Source

toString :: forall provided. ConvertOptionsWithDefaults ToToStringOptions (Record ToStringOptions) (Record provided) (Record ToStringOptions) => Record provided -> PlainYearMonth -> String

Serializes to ISO 8601 year-month format. Options: calendarName.

#toString_ Source

toString_ :: PlainYearMonth -> String

Default ISO 8601 serialization (no options). Prefer over toString {}.

Re-exports from JS.Temporal.PlainYearMonth.Internal