Temporal.PlainDateTime.prototype.daysInMonth
Eingeschränkt verfügbar
Diese Funktion ist nicht Baseline, da sie in einigen der am weitesten verbreiteten Browser nicht funktioniert.
Die daysInMonth Zugriffs-Eigenschaft von Temporal.PlainDateTime Instanzen gibt eine positive Ganzzahl zurück, die die Anzahl der Tage im Monat dieses Datums darstellt. Sie ist abhängig vom Kalender.
Der Set-Zugriff 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 dt = Temporal.PlainDateTime.from("2021-07-01");
console.log(dt.daysInMonth); // 31
Spezifikationen
| Spezifikation |
|---|
| Temporal> # sec-get-temporal.plaindatetime.prototype.daysinmonth> |
Browser-Kompatibilität
Siehe auch
Temporal.PlainDateTimeTemporal.PlainDateTime.prototype.with()Temporal.PlainDateTime.prototype.add()Temporal.PlainDateTime.prototype.subtract()Temporal.PlainDateTime.prototype.yearTemporal.PlainDateTime.prototype.monthTemporal.PlainDateTime.prototype.dayTemporal.PlainDateTime.prototype.daysInWeekTemporal.PlainDateTime.prototype.daysInYearTemporal.PlainDate.prototype.daysInMonth