本文へ移動

Koyomi Calendars暦

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

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

目次

リファレンス · カレンダーアイコン

calendarWeekend関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The Saturday and the Sunday of the weekend a date is in.

The Sunday may be in the next month or year.

インポート

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

定義

function calendarWeekend(year: number, month: number, day: number): { saturday: CalendarDate; sunday: CalendarDate; } | null

引数

名前型説明
yearnumber

Four-digit year.

monthnumber

Month 1 to 12.

daynumber

Day of the month.

戻り値

{ saturday: CalendarDate; sunday: CalendarDate; } | null

The two days, or null for a weekday, a day the month does not have, or a weekend that runs outside years 1 to 9999.

例

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

console.log(calendarWeekend(2026, 11, 7));
console.log(calendarWeekend(2026, 11, 4));
{
  saturday: { year: 2026, month: 11, day: 7 },
  sunday: { year: 2026, month: 11, day: 8 }
}
null

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

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

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