Documentación offline JavaScript main

Temporal.PlainDate.prototype.yearOfWeek

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

En esta página

The yearOfWeek accessor property of {{jsxref("Temporal.PlainDate")}} instances returns an integer representing the year to be paired with the {{jsxref("Temporal/PlainDate/weekOfYear", "weekOfYear")}} of this date, or undefined if the calendar does not have a well-defined week system. It is calendar-dependent.

Usually this is the year of the date, but for ISO 8601, the first and last few days of the year may be attributed to the last week of the previous year or the first week of the next year, causing the yearOfWeek to differ by 1. See {{jsxref("Temporal/PlainDate/weekOfYear", "weekOfYear")}} for more details.

The set accessor of yearOfWeek is undefined. You cannot change this property directly.

Examples#

See the examples in the {{jsxref("Temporal/PlainDate/weekOfYear", "weekOfYear")}} page.

Specifications#

{{Specifications}}

Browser compatibility#

{{Compat}}

See also#

  • {{jsxref("Temporal.PlainDate")}}
  • {{jsxref("Temporal/PlainDate/with", "Temporal.PlainDate.prototype.with()")}}
  • {{jsxref("Temporal/PlainDate/add", "Temporal.PlainDate.prototype.add()")}}
  • {{jsxref("Temporal/PlainDate/subtract", "Temporal.PlainDate.prototype.subtract()")}}
  • {{jsxref("Temporal/PlainDate/year", "Temporal.PlainDate.prototype.year")}}
  • {{jsxref("Temporal/PlainDate/weekOfYear", "Temporal.PlainDate.prototype.weekOfYear")}}
  • {{jsxref("Temporal/PlainDate/dayOfWeek", "Temporal.PlainDate.prototype.dayOfWeek")}}
  • {{jsxref("Temporal/PlainDate/daysInWeek", "Temporal.PlainDate.prototype.daysInWeek")}}
  • {{jsxref("Temporal/PlainDate/daysInYear", "Temporal.PlainDate.prototype.daysInYear")}}