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 · Calendar icons

calendarIconfunction

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 it

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

Definition

function calendarIcon(options: CalendarIconOptions): string

Parameters

NameTypeDescription
optionsCalendarIconOptions

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

Returns

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.

Examples

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

What it prints (run when this page was built)

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