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 · /animate

compareDaysfunction

Which way a turn from one day to another goes.

Import it

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

Definition

function compareDays(from: FlipDate, to: FlipDate): -1 | 0 | 1

Parameters

NameTypeDescription
fromFlipDate

The day shown now.

toFlipDate

The day to turn to.

Returns

0 | 1 | -1

−1 when to is before from, 1 when after, 0 when the same day.

Examples

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

console.log(compareDays({ year: 2026, month: 11, day: 3 }, { year: 2026, month: 11, day: 4 }));
1

What it prints (run when this page was built)

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