Temporal.PlainDateTime.prototype.inLeapYear
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die inLeapYear Accessor-Eigenschaft von Temporal.PlainDateTime-Instanzen gibt einen booleschen Wert zurück, der angibt, ob dieses Datum in einem Schaltjahr liegt. Ein Schaltjahr ist ein Jahr, das aufgrund eines Schalttages oder Schaltmonats mehr Tage als ein normales 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
js
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> # sec-get-temporal.plaindatetime.prototype.inleapyear> |
Browser-Kompatibilität
Siehe auch
Temporal.PlainDateTimeTemporal.PlainDateTime.prototype.with()Temporal.PlainDateTime.prototype.add()Temporal.PlainDateTime.prototype.subtract()Temporal.PlainDateTime.prototype.yearTemporal.PlainDateTime.prototype.daysInYearTemporal.PlainDateTime.prototype.monthsInYearTemporal.PlainDate.prototype.inLeapYear