Temporal.PlainYearMonth.prototype.inLeapYear
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die inLeapYear Accessor-Eigenschaft von Temporal.PlainYearMonth-Instanzen gibt einen booleschen Wert zurück, der angibt, ob das Jahr-Monat in einem Schaltjahr liegt. Ein Schaltjahr ist ein Jahr, das mehr Tage (aufgrund eines Schalttags oder Schaltmonats) als ein gewöhnliches Jahr hat. Es ist kalenderabhängig (calendar).
Der Set-Accessor 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
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
Loading…
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