A Temporal.PlainMonthDay object is an Object that contains integers corresponding to a particular month and day in a particular calendar.
Properties of the Temporal.PlainMonthDay Constructor
The value of the [[Prototype]] internal slot of the Temporal.PlainMonthDay constructor is the intrinsic object %Function.prototype%.
The Temporal.PlainMonthDay constructor has the following properties:
Temporal.PlainMonthDay.prototype
The initial value of `Temporal.PlainMonthDay.prototype` is %Temporal.PlainMonthDay.prototype%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
Temporal.PlainMonthDay.from ( _item_ [ , _options_ ] )
This function performs the following steps when called:
1. Return ? ToTemporalMonthDay(_item_, _options_).
Properties of the Temporal.PlainMonthDay Prototype Object
The Temporal.PlainMonthDay prototype object
- is itself an ordinary object.
- is not a Temporal.PlainMonthDay instance and does not have a [[InitializedTemporalMonthDay]] internal slot.
- has a [[Prototype]] internal slot whose value is %Object.prototype%.
An ECMAScript implementation that includes the ECMA-402 Internationalization API extends this prototype with additional properties in order to represent calendar data.
Temporal.PlainMonthDay.prototype.constructor
The initial value of `Temporal.PlainMonthDay.prototype.constructor` is %Temporal.PlainMonthDay%.
Temporal.PlainMonthDay.prototype[ %Symbol.toStringTag% ]
The initial value of the %Symbol.toStringTag% property is the String value *"Temporal.PlainMonthDay"*.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
get Temporal.PlainMonthDay.prototype.calendarId
`Temporal.PlainMonthDay.prototype.calendarId` is an accessor property whose set accessor function is *undefined*.
Its get accessor function performs the following steps:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Return _monthDay_.[[Calendar]].
get Temporal.PlainMonthDay.prototype.monthCode
`Temporal.PlainMonthDay.prototype.monthCode` is an accessor property whose set accessor function is *undefined*.
Its get accessor function performs the following steps:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Return CalendarISOToDate(_monthDay_.[[Calendar]], _monthDay_.[[ISODate]]).[[MonthCode]].
get Temporal.PlainMonthDay.prototype.day
`Temporal.PlainMonthDay.prototype.day` is an accessor property whose set accessor function is *undefined*.
Its get accessor function performs the following steps:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Return 𝔽(CalendarISOToDate(_monthDay_.[[Calendar]], _monthDay_.[[ISODate]]).[[Day]]).
Temporal.PlainMonthDay.prototype.with ( _temporalMonthDayLike_ [ , _options_ ] )
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. If ? IsPartialTemporalObject(_temporalMonthDayLike_) is *false*, throw a *TypeError* exception.
1. Let _calendar_ be _monthDay_.[[Calendar]].
1. Let _fields_ be ISODateToFields(_calendar_, _monthDay_.[[ISODate]], ~month-day~).
1. Let _partialMonthDay_ be ? PrepareCalendarFields(_calendar_, _temporalMonthDayLike_, « ~year~, ~month~, ~month-code~, ~day~ », « », ~partial~).
1. Set _fields_ to CalendarMergeFields(_calendar_, _fields_, _partialMonthDay_).
1. Let _resolvedOptions_ be ? GetOptionsObject(_options_).
1. Let _overflow_ be ? GetTemporalOverflowOption(_resolvedOptions_).
1. Let _isoDate_ be ? CalendarMonthDayFromFields(_calendar_, _fields_, _overflow_).
1. Return ! CreateTemporalMonthDay(_isoDate_, _calendar_).
Temporal.PlainMonthDay.prototype.equals ( _other_ )
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Set _other_ to ? ToTemporalMonthDay(_other_).
1. If CompareISODate(_monthDay_.[[ISODate]], _other_.[[ISODate]]) ≠ 0, return *false*.
1. Return CalendarEquals(_monthDay_.[[Calendar]], _other_.[[Calendar]]).
Temporal.PlainMonthDay.prototype.toString ( [ _options_ ] )
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Let _resolvedOptions_ be ? GetOptionsObject(_options_).
1. Let _showCalendar_ be ? GetTemporalShowCalendarNameOption(_resolvedOptions_).
1. Return TemporalMonthDayToString(_monthDay_, _showCalendar_).
Temporal.PlainMonthDay.prototype.toLocaleString ( [ _locales_ [ , _options_ ] ] )
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification.
If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used.
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Return TemporalMonthDayToString(_monthDay_, ~auto~).
Temporal.PlainMonthDay.prototype.toJSON ( )
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. Return TemporalMonthDayToString(_monthDay_, ~auto~).
Temporal.PlainMonthDay.prototype.valueOf ( )
This method performs the following steps when called:
1. Throw a *TypeError* exception.
This method always throws, because in the absence of `valueOf()`, expressions with arithmetic operators such as `plainMonthDay1 > plainMonthDay2` would fall back to being equivalent to `plainMonthDay1.toString() > plainMonthDay2.toString()`.
Lexicographical comparison of serialized strings might not seem obviously wrong, because the result would sometimes be correct.
Implementations are encouraged to phrase the error message to point users to `Temporal.PlainDate.compare()` on the corresponding `PlainDate` objects, `Temporal.PlainMonthDay.prototype.equals()`, and/or `Temporal.PlainMonthDay.prototype.toString()`.
Temporal.PlainMonthDay.prototype.toPlainDate ( _item_ )
This method performs the following steps when called:
1. Let _monthDay_ be the *this* value.
1. Perform ? RequireInternalSlot(_monthDay_, [[InitializedTemporalMonthDay]]).
1. If _item_ is not an Object, then
1. Throw a *TypeError* exception.
1. Let _calendar_ be _monthDay_.[[Calendar]].
1. Let _fields_ be ISODateToFields(_calendar_, _monthDay_.[[ISODate]], ~month-day~).
1. Let _inputFields_ be ? PrepareCalendarFields(_calendar_, _item_, « ~year~ », « », « »).
1. Let _mergedFields_ be CalendarMergeFields(_calendar_, _fields_, _inputFields_).
1. Let _isoDate_ be ? CalendarDateFromFields(_calendar_, _mergedFields_, ~constrain~).
1. Return ! CreateTemporalDate(_isoDate_, _calendar_).