Temporal.PlainYearMonth.prototype.daysInMonth
Eingeschränkt verfügbar
Diese Funktion ist nicht Baseline, da sie in einigen der am weitesten verbreiteten Browser nicht funktioniert.
Want more support for this feature? Tell us why.
Die daysInMonth Accessor-Eigenschaft von Temporal.PlainYearMonth Instanzen gibt eine positive ganze Zahl zurück, die die Anzahl der Tage im Monat dieses Datums darstellt. Sie ist von dem Kalender abhängig.
Der Set-Accessor von daysInMonth ist undefined. Sie können diese Eigenschaft nicht direkt ändern.
Für allgemeine Informationen und weitere Beispiele siehe Temporal.PlainDate.prototype.daysInMonth.
Beispiele
>Verwendung von daysInMonth
js
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.daysInMonth); // 31
Spezifikationen
| Spezifikation |
|---|
| Temporal> # sec-get-temporal.plainyearmonth.prototype.daysinmonth> |
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.daysInYearTemporal.PlainDate.prototype.daysInMonth