Temporal.PlainYearMonth.prototype.monthsInYear
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 monthsInYear
Zugriffs-Eigenschaft von Temporal.PlainYearMonth
Instanzen gibt eine positive ganze Zahl zurück, die die Anzahl der Monate im Jahr dieses Datums darstellt. Sie ist abhängig vom Kalender.
Der Set-Zugriff der monthsInYear
Eigenschaft ist undefined
. Sie können diese Eigenschaft nicht direkt ändern.
Für allgemeine Informationen und mehr Beispiele siehe Temporal.PlainDate.prototype.monthsInYear
.
Beispiele
Verwendung von monthsInYear
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.monthsInYear); // 12
Spezifikationen
Specification |
---|
Temporal proposal # sec-get-temporal.plainyearmonth.prototype.monthsinyear |
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.month
Temporal.PlainYearMonth.prototype.monthCode
Temporal.PlainYearMonth.prototype.daysInMonth
Temporal.PlainDate.prototype.monthsInYear