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
| Name | Type | Description |
|---|---|---|
year | number | Four-digit year. |
month | number | 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 28What it prints (run when this page was built)