Temporal.PlainDateTime.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
Zugriffseigenschaft von Instanzen von Temporal.PlainDateTime
gibt einen boolean zurück, der angibt, ob dieses Datum in einem Schaltjahr liegt. Ein Schaltjahr ist ein Jahr, das mehr Tage (aufgrund eines Schalttags oder Schaltmonats) als ein normales Jahr hat. Es ist kalenderabhängig (calendar).
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
const dt = Temporal.PlainDateTime.from("2021-07-01");
console.log(dt.inLeapYear); // false
console.log(dt.daysInYear); // 365
console.log(dt.monthsInYear); // 12
Spezifikationen
Specification |
---|
Temporal proposal # sec-get-temporal.plaindatetime.prototype.inleapyear |
Browser-Kompatibilität
BCD tables only load in the browser
Siehe auch
Temporal.PlainDateTime
Temporal.PlainDateTime.prototype.with()
Temporal.PlainDateTime.prototype.add()
Temporal.PlainDateTime.prototype.subtract()
Temporal.PlainDateTime.prototype.year
Temporal.PlainDateTime.prototype.daysInYear
Temporal.PlainDateTime.prototype.monthsInYear
Temporal.PlainDate.prototype.inLeapYear