本文へ移動

Koyomi Calendars暦

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

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

目次

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

calendarIcon関数

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

An original calendar-page SVG for a month, day and optional year. The library does not read the clock.

The design comes from options.theme (pins when it is left out). Importing this function brings in all 18 designs; to carry one, import its calendarIcon from themes/<name>.

インポート

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

定義

function calendarIcon(options: CalendarIconOptions): string

引数

名前型説明
optionsCalendarIconOptions

The date (month, day, optional year) and the look: theme, scheme, locale, size, housing, rings, turn, preset and the rest of CalendarIconOptions.

戻り値

string

The icon as SVG text, <svg …>…</svg>. It throws a RangeError for a theme, housing, size or turn that is not one of ours.

例

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

const svg = calendarIcon({ theme: "squircle", month: 11, day: 3, year: 2026, scheme: "dark" });
console.log(svg.startsWith("<svg"));
true

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

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

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