Temporal.PlainDateTime.prototype.daysInMonth
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 daysInMonth Zugriffs-Eigenschaft von Instanzen des Objekts Temporal.PlainDateTime gibt eine positive ganze Zahl 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 mehr 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
| Specification |
|---|
| Temporal> # sec-get-temporal.plaindatetime.prototype.daysinmonth> |
Browser-Kompatibilität
Loading…
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