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
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
inLeapYear |
Legend
Tip: you can click/tap on a cell for more information.
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- User must explicitly enable this feature.
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