Temporal.PlainYearMonth.prototype.inLeapYear
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die inLeapYear Zugriffseigenschaft von Temporal.PlainYearMonth-Instanzen gibt einen booleschen Wert zurück, der angibt, ob dieses Jahr-Monat in einem Schaltjahr liegt. Ein Schaltjahr ist ein Jahr, das mehr Tage hat (aufgrund eines zusätzlichen Tages oder Monats) als ein normales Jahr. Es hängt vom Kalender ab.
Der set-Zugriff von inLeapYear ist undefined. Sie können diese Eigenschaft nicht direkt ändern.
Für allgemeine Informationen und weitere Beispiele, siehe Temporal.PlainDate.prototype.inLeapYear.
Beispiele
>Verwendung von inLeapYear
js
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.inLeapYear); // false
console.log(ym.daysInYear); // 365
console.log(ym.monthsInYear); // 12
Spezifikationen
| Specification |
|---|
| Temporal> # sec-get-temporal.plainyearmonth.prototype.inleapyear> |
Browser-Kompatibilität
Siehe auch
Temporal.PlainYearMonthTemporal.PlainYearMonth.prototype.with()Temporal.PlainYearMonth.prototype.add()Temporal.PlainYearMonth.prototype.subtract()Temporal.PlainYearMonth.prototype.yearTemporal.PlainYearMonth.prototype.daysInYearTemporal.PlainYearMonth.prototype.monthsInYearTemporal.PlainDate.prototype.inLeapYear