CalendarIconOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What calendarIcon takes: the date, the design and the look of one calendar page.
Only month and day are required.
インポート
import type { CalendarIconOptions } from "@johnmorrisdotca/koyomi-calendars";
定義
interface CalendarIconOptions {
month: number;
day: number;
year?: number;
theme?: CalendarTheme;
locale?: string;
scheme?: "light" | "dark";
size?: number;
weekend?: "split";
holidays?: Readonly<Record<string, string | {
readonly en?: string;
readonly ja?: string;
}>>;
mark?: string;
columns?: boolean;
japanese?: boolean | {
readonly holidays?: boolean;
readonly oldDate?: boolean;
readonly rokuyo?: boolean;
};
moon?: boolean;
housing?: CalendarHousing;
housingColour?: string;
rings?: boolean | number;
turn?: number;
preset?: CalendarPreset;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
month | number | Month 1–12. |
day | number | Day of the month 1–31. |
year (省略可) | number | undefined | Four-digit year. Names the weekday (and a small year) where a theme draws them; omit it to leave both off. |
theme (省略可) | "pins" | "loops" | "shadow" | "heavy" | "cartoon" | "flip" | "stack" | "line" | "curl" | "soft" | "desk" | "thin" | "frame" | "badge" | "sun" | "roll" | "plain" | "squircle" | undefined | |
locale (省略可) | string | undefined |
|
scheme (省略可) | "light" | "dark" | undefined | |
size (省略可) | number | undefined | Width in CSS pixels. Height follows the theme's shape. Default 96. |
weekend (省略可) | "split" | undefined |
|
holidays (省略可) | Readonly<Record<string, string | { readonly en?: string; readonly ja?: string; }>> | undefined | Holiday names for the side columns, by date ( |
mark (省略可) | string | undefined | SVG shapes that replace the sun's red disc: drawn in a box from -100,-100 to 100,100 centred behind the day. Your own markup, written as given: no scripts, styles, event attributes or foreign objects. |
columns (省略可) | boolean | undefined | The side columns of |
japanese (省略可) | boolean | { readonly holidays?: boolean; readonly oldDate?: boolean; readonly rokuyo?: boolean; } | undefined | What the side columns add from the Japanese calendar, computed ( |
moon (省略可) | boolean | undefined | The moon phase on |
housing (省略可) | "square" | "circle" | undefined |
|
housingColour (省略可) | string | undefined | The disc's colour, any CSS colour. A soft blue (a deep one in dark) by default. |
rings (省略可) | number | boolean | undefined | Spiral rings across the top of the page, on the themes that have no binding of their own ( |
turn (省略可) | number | undefined | A slight turn of the whole icon, in degrees, clockwise when positive (older macOS icons stood a little askew). −45 to 45. Default 0. |
preset (省略可) | "flat" | "disc" | "ringed" | "tilted" | "disc-ringed" | undefined | A named set of the three options above ( |
例
import { calendarIcon, type CalendarIconOptions } from "@johnmorrisdotca/koyomi-calendars";
const options: CalendarIconOptions = { month: 7, day: 17, year: 2026, theme: "badge", scheme: "light" };
console.log(calendarIcon(options).length > 100);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。