Temporal.PlainYearMonth.prototype.daysInMonth
Базовый уровень Ограниченная доступность
Эта функция не относится к Базовому уровню, поскольку она не работает в некоторых наиболее широко используемых браузерах.
Свойство-аксессор daysInMonth экземпляров Temporal.PlainYearMonth возвращает положительное целое число, представляющее количество дней в месяце этой даты. Оно зависит от календаря.
Сет-аксессор daysInMonth — undefined. Вы не можете изменить это свойство напрямую.
Общую информацию и дополнительные примеры см. в разделе Temporal.PlainDate.prototype.daysInMonth.
Примеры
Использование daysInMonth
const ym = Temporal.PlainYearMonth.from("2021-07");
console.log(ym.daysInMonth); // 31
Спецификации
Совместимость с браузерами
| Настольные | Мобильные | Серверные | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
daysInMonth |
144 |
144 |
139 |
128 |
предпросмотр |
144 |
139 |
95 |
Нет |
Нет |
144 |
Нет |
1.4.0 |
2.7 |
26.0.0 |
См. также
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
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth/daysInMonth