monthGrid関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The weeks of a month: whole weeks of seven, from the week of the 1st to the week of the last day.
インポート
import { monthGrid } from "@johnmorrisdotca/koyomi-calendars/month";
定義
function monthGrid(year: number, month: number, weekStart?: WeekStart): MonthGrid
引数
| 名前 | 型 | 説明 |
|---|---|---|
year | number | Four-digit year. |
month | number | Month 1 to 12. |
weekStart (省略可) | WeekStart | The first column, |
戻り値
MonthGrid
The grid: how many days the month has, how many cells come before the 1st, and 4, 5 or 6 weeks of seven days.
例
import { monthGrid } from "@johnmorrisdotca/koyomi-calendars/month";
const grid = monthGrid(2026, 11, "monday");
console.log(grid.offset, grid.weeks.map((week) => week[0]!.day).join(" "));6 26 2 9 16 23 30出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。