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
| Name | Type | Description |
|---|---|---|
from | FlipDate | The day shown now. |
to | FlipDate | 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 }));1What it prints (run when this page was built)