Documentación offline JavaScript main

Temporal.PlainDate.prototype.calendarId

main Documentación oficial Licencia CC-BY-SA-2.5Descargado el 2026-08-02

En esta página

The calendarId accessor property of {{jsxref("Temporal.PlainDate")}} instances returns a string representing the calendar used to interpret the internal ISO 8601 date.

See Intl.supportedValuesOf() for a list of commonly supported calendar types.

The set accessor of calendarId is undefined. You cannot change this property directly. Use the {{jsxref("Temporal/PlainDate/withCalendar", "withCalendar()")}} method to create a new Temporal.PlainDate object with the desired new value.

Examples#

Using calendarId#

const date = Temporal.PlainDate.from("2021-07-01");
console.log(date.calendarId); // "iso8601"; default

const date2 = Temporal.PlainDate.from("2021-07-01[u-ca=chinese]");
console.log(date2.calendarId); // "chinese"

const date3 = date2.withCalendar("hebrew");
console.log(date3.calendarId); // "hebrew"

Specifications#

{{Specifications}}

Browser compatibility#

{{Compat}}

See also#

  • {{jsxref("Temporal.PlainDate")}}