Temporal.PlainDateTime.prototype.daysInMonth
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thuộc tính accessor daysInMonth của các instance Temporal.PlainDateTime trả về một số nguyên dương đại diện cho số ngày trong tháng của ngày này. Nó phụ thuộc vào lịch.
Set accessor của daysInMonth là undefined. Bạn không thể thay đổi thuộc tính này trực tiếp.
Để biết thông tin chung và thêm ví dụ, xem Temporal.PlainDate.prototype.daysInMonth.
Ví dụ
>Sử dụng daysInMonth
js
const dt = Temporal.PlainDateTime.from("2021-07-01");
console.log(dt.daysInMonth); // 31
Đặc tả
| Specification |
|---|
| Temporal> # sec-get-temporal.plaindatetime.prototype.daysinmonth> |
Tương thích trình duyệt
Xem thêm
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