JavaScript Temporal PlainMonthDay
Temporal.PlainMonthDay
The Temporal.PlainMonthDay() object represents the month and day of an ISO 8601 calendar date, without a year or a time zone like (e.g. 05-17).
The Temporal.PlainMonthDay Object
The Temporal.PlainMonthDay() object is a month and day object.
It represents the month and day of an ISO 8601 calendar date, without a year or a time zone.
Example: 05-17.
Creating a PlainMonthDay Object
The Temporal.PlainMonthDay Properties
The Temporal.PlainMonthDay has 3 properties of calendar date information.
The Temporal.PlainMonthDay Format
The PlainMonthDay object is parsed using the RFC 9557 format (an extension to the ISO 8601 / RFC 3339 format):
Syntax
MM-DD
Or with a calendar (optional):
MM-DD[u-ca=calendar_id]
PlainMonthDay Methods
| Method | Description |
|---|---|
| equals() | Returns true if two PlainDate objects are identical |
| from() | Returns a new PlainDate object from another object or a string |
| toPlainDate() | Returns a new PlainDate object |
| with() | Returns a new PlainDate with specified fields modified |
| withCalendar() | Returns a new PlainDate with a different calendar system |
| Formatting | |
| toJSON() | Returns an RFC 9557 format string for JSON serialization |
| toLocaleString() | Returns a language-sensitive representation of the date |
| toString() | Returns an RFC 9557 format string representation |
| valueOf() | Throws a TypeError (prevents temporals from being converted to primitives) |
PlainMonthDay Properties
| Property | Description |
| calendarID | Calendar system identifier ("iso8601") |
| day | The day as an integer (1-31) |
| monthCode | A calendar-specific string code for the month ("M01") |
Note
The Temporal.PlainMonthDay object does not have a month property.