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

daysInMonthfunction

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 it

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

Definition

function daysInMonth(year: number, month: number): number

Parameters

NameTypeDescription
yearnumber

Four-digit year.

monthnumber

Month 1 to 12.

Returns

number

28, 29, 30 or 31.

Examples

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

console.log(daysInMonth(2028, 2), daysInMonth(2026, 2));
29 28

What it prints (run when this page was built)

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