Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

Reference · Marking, scores and game rules

dayKeyfunction

The calendar day a moment falls on, as YYYY-MM-DD: in UTC unless an IANA time zone such as Asia/Tokyo is named. A name is passed on to Intl, which throws a RangeError for a zone it does not know.

Import it

import { dayKey } from "@johnmorrisdotca/kotoba";

Definition

function dayKey(moment?: Date | number, zone?: string): DayKey

Parameters

NameTypeDescription
moment (optional)number | Date

A Date or Unix milliseconds to interpret.

zone (optional)string | undefined

An optional IANA time zone; UTC when omitted.

Returns

string

The calendar day a moment falls on, as YYYY-MM-DD: in UTC unless an IANA time zone such as Asia/Tokyo is named. A name is passed on to Intl, which throws a RangeError for a zone it does not know.

Examples

import { dayKey } from "@johnmorrisdotca/kotoba";

console.log(dayKey(new Date("2026-10-12T12:00:00Z")));
2026-10-12

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.2.0.