Reference · Marking, scores and game rules
isDayKeyfunction
Whether the text is a real calendar date written YYYY-MM-DD, from the year 0000 to 9999.
Import it
import { isDayKey } from "@johnmorrisdotca/kotoba";
Definition
function isDayKey(text: unknown): text is DayKey
Parameters
| Name | Type | Description |
|---|---|---|
text | unknown | The date text to validate, or localized template specified by the signature. |
Returns
boolean
Whether the text is a real calendar date written YYYY-MM-DD, from the year 0000 to 9999.
Examples
import { isDayKey } from "@johnmorrisdotca/kotoba";
console.log(isDayKey("2026-10-12"));trueWhat it prints (run when this page was built)