Temporal.PlainDate.prototype.yearOfWeek
Temporal.PlainDate 实例的 **yearOfWeek** 访问器属性返回一个整数,表示与该日期的 weekOfYear 配对的年份,如果日历没有明确定义的周系统,则返回 undefined。它取决于 calendar。
通常这是日期的年份,但对于 ISO 8601,年份的开头和结尾几天可能属于上一年的最后一周或下一年的第一周,导致 yearOfWeek 出现 1 的差异。有关更多详细信息,请参阅 weekOfYear。
yearOfWeek 的设置器为 undefined。你不能直接更改此属性。
示例
请参阅 weekOfYear 页面的示例。
规范
| 规范 |
|---|
| Temporal # sec-get-temporal.plaindate.prototype.yearofweek |
浏览器兼容性
加载中…
另见
Temporal.PlainDateTemporal.PlainDate.prototype.with()Temporal.PlainDate.prototype.add()Temporal.PlainDate.prototype.subtract()Temporal.PlainDate.prototype.yearTemporal.PlainDate.prototype.weekOfYearTemporal.PlainDate.prototype.dayOfWeekTemporal.PlainDate.prototype.daysInWeekTemporal.PlainDate.prototype.daysInYear