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 Zugriffs-Eigenschaft inLeapYear
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 (aufgrund eines Schalttages oder Schaltmonats) als ein gewöhnliches Jahr hat. Es ist abhängig vom Kalender.
Der Set-Zugriff von inLeapYear
ist undefined
. Sie können diese Eigenschaft nicht direkt ändern.
Für allgemeine Informationen und mehr 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 proposal # sec-get-temporal.plainyearmonth.prototype.inleapyear |
Browser-Kompatibilität
BCD tables only load in the browser
Siehe auch
Temporal.PlainYearMonth
Temporal.PlainYearMonth.prototype.with()
Temporal.PlainYearMonth.prototype.add()
Temporal.PlainYearMonth.prototype.subtract()
Temporal.PlainYearMonth.prototype.year
Temporal.PlainYearMonth.prototype.daysInYear
Temporal.PlainYearMonth.prototype.monthsInYear
Temporal.PlainDate.prototype.inLeapYear