@whenis/locale-en
v0.4.0
Published
English locale for whenis — today/tomorrow/yesterday, next/this weekday, basic month-day forms and durations.
Maintainers
Readme
@whenis/locale-en
English locale for whenis.
Basic English vocabulary and rules for relative dates. The English locale exists primarily as a sanity check that the locale-as-data design holds across language families; it is intentionally narrow at v0.1 and will be fleshed out as use cases appear.
Covered today:
today/tomorrow/yesterdaynext <weekday>/this <weekday>/last <weekday>- Numeral + time unit (
3 days,2 weeks) → duration - Months and weekdays as lexicon entries
Install
pnpm add @whenis/core @whenis/locale-enUsage
import { createParser } from '@whenis/core';
import { en } from '@whenis/locale-en';
const parser = createParser({ locales: [en], options: { preferFuture: true } });
parser.parse('next Friday', { reference: new Date('2026-05-28') });
// → matches[0].candidates[0]: { type: 'date', date: '2026-06-05', confidence: 1 }
parser.parse('tomorrow', { reference: new Date('2026-05-28') });
// → matches[0].candidates[0]: { type: 'date', date: '2026-05-29', confidence: 1 }License
MIT © Nazar Fedyshyn
