PlainDate
The Temporal.PlainDate object represents a calendar date (year, month, day) with no time or time zone.
See: Temporal.PlainDate
Fields
- _inner:*abi.c.PlainDate
Internal pointer to the underlying C PlainDate object.
Types
- ToStringOptions
Options for
toString()method.- CalendarDisplay
Controls how the calendar is displayed in string output.
- ToZonedDateTimeOptions
Options for
toZonedDateTime()method.- WithOptions
Options for
with()method.
Functions
- init
Creates a new PlainDate from the given ISO year, month, and day.
- calInit
Creates a new PlainDate with a specific calendar.
- from
Creates a PlainDate from another PlainDate or from a string (ISO 8601) or UTF-16 array.
- compare
Compares two PlainDate objects. Returns -1, 0, or 1.
- equals
Returns true if two PlainDate objects represent the same date.
- add
Returns a new PlainDate by adding a Duration to this date.
- subtract
Returns a new PlainDate by subtracting a Duration from this date.
- until
Returns the Duration until another PlainDate, according to the given settings.
- since
Returns the Duration since another PlainDate, according to the given settings.
- with
Returns a new PlainDate with some fields replaced.
- withCalendar
Returns a new PlainDate with a different calendar.
- toPlainDateTime
Returns a PlainDateTime by combining this date with a PlainTime (or midnight if null).
- toPlainMonthDay
Returns a PlainMonthDay representing the month and day in this date.
- toPlainYearMonth
Returns a PlainYearMonth representing the year and month in this date.
- toZonedDateTime
Returns a ZonedDateTime by combining this date with a time and time zone.
- toString
Returns a string representation of the date.
- toJSON
Returns a string suitable for use as JSON.
- toLocaleString
Not implemented. Throws TemporalNotImplemented error.
- valueOf
Not supported. Throws TemporalValueOfNotSupported error.
- day
Returns the day of the month (1-31).
- dayOfWeek
Returns the day of the week (1 = Monday, 7 = Sunday).
- dayOfYear
Returns the day of the year (1-366).
- daysInMonth
Returns the number of days in the month for this date.
- daysInWeek
Returns the number of days in the week for this date.
- daysInYear
Returns the number of days in the year for this date.
- monthCode
Returns the month code (e.g., "M03").
- month
Returns the month (1-12).
- monthsInYear
Returns the number of months in the year for this date.
- year
Returns the year.
- inLeapYear
Returns true if the year is a leap year.
- calendarId
Returns the calendar identifier for this date.
- era
Returns the era for this date, if any.
- eraYear
Returns the era year for this date, if any.
- weekOfYear
Returns the week of the year for this date, if any.
- yearOfWeek
Returns the year of the week for this date, if any.
- deinit
Frees resources associated with this PlainDate.
Aliases
- Unit
Units used for date and time calculations.
- RoundingMode
Rounding modes for date/time operations.
- Sign
Sign type for durations.
- DifferenceSettings
Settings for difference calculations between dates.