Temporal.PlainDateTime.prototype.day
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 day của các instance Temporal.PlainDateTime trả về một số nguyên dương đại diện cho chỉ số ngày theo cơ số 1 trong tháng của ngày này, đây là số ngày giống như bạn thấy trên lịch. Nó phụ thuộc vào lịch.
Set accessor của day là undefined. Bạn không thể thay đổi thuộc tính này trực tiếp. Sử dụng phương thức with() để tạo một đối tượng Temporal.PlainDateTime mới với giá trị mới mong muốn.
Để biết thông tin chung và thêm ví dụ, xem Temporal.PlainDate.prototype.day.
Ví dụ
>Sử dụng day
js
const dt = Temporal.PlainDateTime.from("2021-07-01"); // ISO 8601 calendar
console.log(dt.day); // 1
Đặc tả
| Specification |
|---|
| Temporal> # sec-get-temporal.plaindatetime.prototype.day> |
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.daysInMonthTemporal.PlainDateTime.prototype.dayOfWeekTemporal.PlainDateTime.prototype.dayOfYearTemporal.PlainDate.prototype.day