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

calendarLayoutfunction

The box, the page and the year's room of a theme, with and without a year.

A weekend page places its numerals on the diagonal, on purpose, the same for every weekend.

Import it

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

Definition

function calendarLayout(theme: CalendarTheme, withYear: boolean, weekend?: boolean): CalendarLayout & { box: Rect; numeral: "centre" | "diagonal"; }

Parameters

NameTypeDescription
theme"pins" | "loops" | "shadow" | "heavy" | "cartoon" | "flip" | "stack" | "line" | "curl" | "soft" | "desk" | "thin" | "frame" | "badge" | "sun" | "roll" | "plain" | "squircle"

The design to measure.

withYearboolean

Whether the icon shows a year, which takes room.

weekend (optional)boolean

Whether to lay out a weekend page (only the designs that have one answer differently).

Returns

CalendarLayout & { box: Rect; numeral: "centre" | "diagonal"; }

The theme's box (x, y, width, height), the page the day is centred in, the yearZone, and whether the numerals sit in the centre or on the diagonal.

Examples

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

const layout = calendarLayout("squircle", true);
console.log(layout.box.join(" "), layout.numeral);
0 0 256 256 centre

What it prints (run when this page was built)

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