Skip to main content
class Temporal.PlainDate

A Temporal.PlainDate represents a calendar date. "Calendar date" refers to the concept of a date as expressed in everyday usage, independent of any time zone. For example, it could be used to represent an event on a calendar which happens during the whole day no matter which time zone it's happening in.

See https://tc39.es/proposal-temporal/docs/date.html for more details.

Constructors

new
PlainDate(
isoYear: number,
isoMonth: number,
isoDay: number,
calendar?: CalendarLike,
)

Properties

readonly
calendarId: string
readonly
day: number
readonly
dayOfWeek: number
readonly
dayOfYear: number
readonly
daysInMonth: number
readonly
daysInWeek: number
readonly
daysInYear: number
readonly
era: string | undefined
readonly
eraYear: number | undefined
readonly
inLeapYear: boolean
readonly
month: number
readonly
monthCode: string
readonly
monthsInYear: number
readonly
weekOfYear: number
readonly
year: number
readonly
yearOfWeek: number
readonly
[Symbol.toStringTag]: "Temporal.PlainDate"

Methods

add(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate
equals(other: Temporal.PlainDate | PlainDateLike | string): boolean
getCalendar(): CalendarProtocol
getISOFields(): PlainDateISOFields
since(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<
| "year"
| "month"
| "week"
| "day"
>
): Temporal.Duration
subtract(durationLike: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions): Temporal.PlainDate
toJSON(): string
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string
toPlainDateTime(temporalTime?: Temporal.PlainTime | PlainTimeLike | string): Temporal.PlainDateTime
toString(options?: ShowCalendarOption): string
toZonedDateTime(timeZoneAndTime: TimeZoneProtocol | string | { timeZone: TimeZoneLike; plainTime?: Temporal.PlainTime | PlainTimeLike | string; }): Temporal.ZonedDateTime
until(other: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<
| "year"
| "month"
| "week"
| "day"
>
): Temporal.Duration
valueOf(): never
with(dateLike: PlainDateLike, options?: AssignmentOptions): Temporal.PlainDate
withCalendar(calendar: CalendarLike): Temporal.PlainDate

Static Methods

compare(one: Temporal.PlainDate | PlainDateLike | string, two: Temporal.PlainDate | PlainDateLike | string): ComparisonResult
from(item: Temporal.PlainDate | PlainDateLike | string, options?: AssignmentOptions): Temporal.PlainDate