Temporal.PlainMonthDay
- Package
- purescript-temporal
- Repository
- philippedev101/purescript-temporal
Construction and inspection of PlainMonthDay values.
A PlainMonthDay represents a month and day without a year component
(e.g. 12-25). Useful for recurring annual dates like birthdays or holidays.
Note: PlainMonthDay has Eq but not Ord, because ordering month-day
pairs without a year is ambiguous (leap day considerations).
#plainMonthDay Source
plainMonthDay :: Int -> Int -> Maybe PlainMonthDayConstruct from month (1–12) and day (1–31). Returns Nothing for
invalid combinations (e.g. month 2, day 30).
#fromString Source
fromString :: String -> Maybe PlainMonthDayParse an ISO 8601 month-day string (e.g. "--12-25").
Returns Nothing for invalid strings.
#getMonthCode Source
getMonthCode :: PlainMonthDay -> StringMonth code string (e.g. "M12" for December).
#getDay Source
getDay :: PlainMonthDay -> IntDay of the month (1–31).
#with Source
with :: { day :: Int, month :: Int } -> PlainMonthDay -> Maybe PlainMonthDayCreate a modified copy with the given month and day. Returns Nothing
if the result would be invalid.
#toPlainDate Source
toPlainDate :: Int -> PlainMonthDay -> Maybe PlainDateConvert to a PlainDate by specifying a year. Out-of-range days are
constrained — e.g. Feb 29 in a non-leap year yields Feb 28.
Returns Nothing for truly invalid values.
#toString Source
toString :: PlainMonthDay -> StringSerialize to an ISO 8601 month-day string (e.g. "--12-25").
Re-exports from Temporal.Internal.Types
#PlainMonthDay Source
data PlainMonthDayA month and day without a year component (e.g. 12-25).
Useful for recurring annual dates like birthdays or holidays.