Timezone Mismatch

Timezone Mismatch is a copy-paste React component that stops misread every time by hours while travelling 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/timezone-mismatch
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 4 extra npm packages
  • A11y guidance in docs

StopsMisread every time by hours while travelling

Was this component page useful?

How do I install Timezone Mismatch?

pnpm dlx shadcn@latest add @bollard/timezone-mismatch

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

How do I use Timezone Mismatch in React?

timezone-mismatch-usage.tsx
import { TimezoneMismatch, zoneCity } from "@/components/ui/timezone-mismatch"

<TimezoneMismatch
  key={run}
  accountTimeZone={zone}
  deviceTimeZone="Europe/London"
  storageKey={storageKey}
  onUseDeviceZone={setZone}
/>

What input mistakes does Timezone Mismatch catch?

  • Device and account zones that differ now or at any clock change in the coming year
  • Zones that drift apart only for a few days (e.g. Jerusalem and Athens)
  • Unknown zones the runtime can't resolve
  • The user's choice, remembered per pair of zones

What props does Timezone Mismatch accept?

TimezoneMismatch props
PropTypeDefault
accountTimeZone* (required)

The time zone saved on the account; times are shown in it today.

string—
deviceTimeZone

Override the detected device zone (tests, demos, or a zone from your own location service).

string—
onUseDeviceZone* (required)

Switch the account (or this session) to the device zone.

(timeZone: string) => void—
onKeepAccountZone

Called when the user keeps the account zone.

() => void—
storageKey

localStorage key that remembers the answer per account → device zone pair. `null` disables it.

string | null"bollard-ui:timezone-choice"
message

Templates: `{device}`, `{account}` (city names) and `{gap}` ("5 h 30 min ahead") are filled in.

string"You're in {device} time, {gap} of your account's {accoun…
deviceLabel

Label of the device clock.

string"Device"
accountLabel

Label of the account clock.

string"Account"
useDeviceLabel

Label of the use-device-zone button.

string"Use device zone"
keepAccountLabel

Label of the keep-account-zone button.

string"Keep account zone"
doneText

Shown for a moment after the answer. `{zone}` is the city now used.

string"Times now show in {zone} time."
regionLabel

Accessible name of the banner.

string"Time zone mismatch"

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

How is Timezone Mismatch accessible?

  • Banner is a region with an aria-label; result is role=status and receives focus
  • Message in a polite live region
  • Animations respect reduced motion

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

What are the limitations and server boundaries?

  • Choice is stored in localStorage on this device
  • Device zone comes from the browser and can be wrong behind some VPNs or settings

What expensive mistakes does Timezone Mismatch stop?

Misread every time by hours while travelling

Also known as

time zone · timezone · device time · account time zone · travel · ist · tz database · clock

Field type

What dependencies does Timezone Mismatch require?

Timezone Mismatch facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameTimezone Mismatch
Registry identifier@bollard/timezone-mismatch
Install commandnpx shadcn@latest add @bollard/timezone-mismatch
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, @date-fns/tz, @number-flow/react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-11-15
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 Timezone Mismatch

How does Timezone Mismatch handle date and time accuracy?

Timezone Mismatch catches misread every time by hours while travelling. Validates calendar constraints: Device and account zones that differ now or at any clock change in the coming year, Zones that drift apart only for a few days (e.g. Jerusalem and Athens), Unknown zones the runtime can't resolve, The user's choice, remembered per pair of zones. Limitation: match timezone-mismatch with server timezone.

How do I install timezone-mismatch with shadcn?

Run `npx shadcn@latest add @bollard/timezone-mismatch`. Sources added: registry/default/timezone-mismatch/timezone-mismatch.tsx. Package requirements: lucide-react, @date-fns/tz, @number-flow/react, motion.

What props customize Timezone Mismatch?

Timezone Mismatch accepts `accountTimeZone`, `deviceTimeZone`, `onUseDeviceZone`, `onKeepAccountZone`, `storageKey`. Configures time zone, timezone, device time behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of timezone-mismatch?

Choice is stored in localStorage on this device. Device zone comes from the browser and can be wrong behind some VPNs or settings Server requirement: backend verification for timezone-mismatch.

How does Timezone Mismatch meet accessibility guidelines?

Banner is a region with an aria-label; result is role=status and receives focus. Message in a polite live region. Animations respect reduced motion. Minimizes errors: wrong time zone while travelling, device timezone differs from account.

Which components pair with Timezone Mismatch?