daysInMonth関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How many days a month has: leap years by the Gregorian rule (a year divisible by 4, but not by 100 unless by 400).
インポート
import { daysInMonth } from "@johnmorrisdotca/koyomi-calendars/month";
定義
function daysInMonth(year: number, month: number): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
year | number | Four-digit year. |
month | number | Month 1 to 12. |
戻り値
number
28, 29, 30 or 31.
例
import { daysInMonth } from "@johnmorrisdotca/koyomi-calendars/month";
console.log(daysInMonth(2028, 2), daysInMonth(2026, 2));29 28出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。