Skip to the content

Koyomi Calendars暦

Calendar pages as SVG: a day as an icon in 18 original designs, a whole month as a poster or a desk pad, and the page turning from one day to the next.

Koyomi is the Japanese word 暦 for the calendar. About the name

Contents

Reference · /month

monthGridfunction

The weeks of a month: whole weeks of seven, from the week of the 1st to the week of the last day.

Import it

import { monthGrid } from "@johnmorrisdotca/koyomi-calendars/month";

Definition

function monthGrid(year: number, month: number, weekStart?: WeekStart): MonthGrid

Parameters

NameTypeDescription
yearnumber

Four-digit year.

monthnumber

Month 1 to 12.

weekStart (optional)WeekStart

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

Returns

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.

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/koyomi-calendars 0.3.0.