本文へ移動

Koyomi Calendars暦

カレンダーのページをSVGで描きます。1日を18種類のアイコンで、1か月をポスターや卓上カレンダーで、そして日めくりも使えます。

「暦」(こよみ) は、カレンダーのことです。 名前について(英語)

目次

リファレンス · /month

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

引数

名前型説明
yearnumber

Four-digit year.

monthnumber

Month 1 to 12.

weekStart (省略可)WeekStart

The first column, "sunday" (the default) or "monday".

戻り値

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/koyomi-calendars 0.3.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。