Unambiguous Date

Unambiguous Date is a copy-paste React component that stops 03/04 read as march instead of april before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/unambiguous-date
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

Stops03/04 read as March instead of April

Was this component page useful?

How do I install Unambiguous Date?

pnpm dlx shadcn@latest add @bollard/unambiguous-date

The files land in your project. They're yours to edit.

How do I use Unambiguous Date in React?

unambiguous-date-usage.tsx
import { UnambiguousDate, type DateOrder } from "@/components/ui/unambiguous-date"

<UnambiguousDate value={new Date(2026, 9, 18)} now={TODAY} showWeekday />

What input mistakes does Unambiguous Date catch?

  • Numeric dates with two valid readings (03/10/2026)
  • Impossible dates like 31/02, rejected instead of rolled over
  • Year-first ISO dates, read unambiguously
  • One answer applied to every date in a column

What props does Unambiguous Date accept?

UnambiguousDate props
PropTypeDefault
value* (required)

A Date, an ISO string, or a numeric string like "03/10/2026".

Date | string—
prefer

Which reading to show first when a numeric string is ambiguous.

"DMY" | "MDY""DMY"
now

Reference time for "in 5 days". Defaults to the client clock after mount.

Date—
locale

Locale for month and relative wording. The day-month-year order is fixed.

string"en"
showWeekday

Prefix the weekday: "Sat, 3 Oct 2026".

booleanfalse
onResolve

Called when the user picks a reading for an ambiguous input, or with `null` when they undo it.

(reading: DateReading | null) => void—
order

The reading already chosen for this source, e.g. the order a whole CSV column was confirmed in. When set, ambiguous values use it without asking. Pair with `onResolve` to remember a choice.

"DMY" | "MDY" | null—
invalidMessage

Shown when the value isn't a date.

string"isn’t a date"
readAsText

`{order}` is a reading name.

string"read as {order}"
changeLabel

Label of the change-reading button.

string"change"
alsoText

`{input}` and `{date}` are filled in.

string"“{input}” could also mean {date}."
readingNames

Names of each reading, e.g. `{ DMY: "day/month" }`.

Partial<Record<DateOrder, string>>—

* required. Also accepts the native props of <span> (className, aria-*, data-*…), passed through to it.

How is Unambiguous Date accessible?

  • Readback in a polite live region with a <time dateTime> element
  • Choice buttons are labelled; focus moves to the chosen reading
  • Icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Numeric formats only; month names are not parsed here
  • Two-digit years may be ambiguous

What expensive mistakes does Unambiguous Date stop?

03/04 read as March instead of April

Also known as

date format · dd/mm/yyyy · mm/dd/yyyy · date picker · csv import · relative date · dob · locale

Field type

What dependencies does Unambiguous Date require?

Unambiguous Date facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameUnambiguous Date
Registry identifier@bollard/unambiguous-date
Install commandnpx shadcn@latest add @bollard/unambiguous-date
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Unambiguous Date

How does Unambiguous Date validate Indian financial identifiers?

Unambiguous Date stops 03/04 read as March instead of April. Complies with national standards for Numeric dates with two valid readings (03/10/2026), Impossible dates like 31/02, rejected instead of rolled over, Year-first ISO dates, read unambiguously, One answer applied to every date in a column. Limitation: verify unambiguous-date with issuer gateway.

How do I install unambiguous-date with shadcn?

Run `npx shadcn@latest add @bollard/unambiguous-date`. Sources added: registry/default/unambiguous-date/unambiguous-date.tsx. Package requirements: lucide-react.

What props customize Unambiguous Date?

Unambiguous Date accepts `value`, `prefer`, `now`, `locale`, `showWeekday`. Configures date format, dd/mm/yyyy, mm/dd/yyyy behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of unambiguous-date?

Numeric formats only; month names are not parsed here. Two-digit years may be ambiguous Server requirement: backend verification for unambiguous-date.

How does Unambiguous Date meet accessibility guidelines?

Readback in a polite live region with a <time dateTime> element. Choice buttons are labelled; focus moves to the chosen reading. Icons are aria-hidden. Minimizes errors: dd mm vs mm dd, date format confusion.

Which components pair with Unambiguous Date?