Temporal.PlainYearMonth.prototype.daysInYear
Temporal.PlainYearMonth 例項的 daysInYear 訪問器屬性返回一個正整數,表示此日期所在年份的天數。它取決於日曆。
daysInYear 的設定訪問器為 undefined。你不能直接更改此屬性。
有關一般資訊和更多示例,請參見 Temporal.PlainDate.prototype.daysInYear。
示例
使用 daysInYear
js
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.daysInYear); // 365
規範
| 規範 |
|---|
| Temporal # sec-get-temporal.plainyearmonth.prototype.daysinyear |
瀏覽器相容性
載入中…