Temporal.PlainYearMonth.prototype.monthsInYear
Eingeschränkt verfügbar
Diese Funktion ist nicht Baseline, da sie in einigen der am weitesten verbreiteten Browser nicht funktioniert.
Want more browser support for this feature? Tell us why.
Die monthsInYear-Zugriffseigenschaft von Temporal.PlainYearMonth-Instanzen gibt eine positive ganze Zahl zurück, die die Anzahl der Monate im Jahr dieses Datums repräsentiert. Sie ist kalenderabhängig (calendar).
Der Set-Zugriff von monthsInYear ist undefined. Sie können diese Eigenschaft nicht direkt ändern.
Allgemeine Informationen und weitere Beispiele finden Sie unter Temporal.PlainDate.prototype.monthsInYear.
Beispiele
>Verwendung von monthsInYear
js
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.monthsInYear); // 12
Spezifikationen
| Spezifikation |
|---|
| Temporal> # sec-get-temporal.plainyearmonth.prototype.monthsinyear> |
Browser-Kompatibilität
Siehe auch
Temporal.PlainYearMonthTemporal.PlainYearMonth.prototype.with()Temporal.PlainYearMonth.prototype.add()Temporal.PlainYearMonth.prototype.subtract()Temporal.PlainYearMonth.prototype.yearTemporal.PlainYearMonth.prototype.monthTemporal.PlainYearMonth.prototype.monthCodeTemporal.PlainYearMonth.prototype.daysInMonthTemporal.PlainDate.prototype.monthsInYear