Date and time picker with time zones
Pick a day and an hour in a time zone. The value carries the offset of the zone at that instant. When the reader changes the zone, the instant stays and the clock moves.
The code
import { createDatePicker } from '@nervure/datetime';
createDatePicker('#field', {
time: true,
zone: 'Europe/Paris',
zones: ['Europe/Paris', 'UTC', 'America/New_York', 'Asia/Tokyo'],
onChange: (selection) => console.log(selection.value, selection.start, selection.end),
});The value is '2026-12-04T14:30+01:00'. Read the guide for every option, and see every example.
What it does
- Any IANA zone, with the zone data of the browser: the package ships none.
- Summer and winter time are right:
+01:00in December,+02:00in July. - An hour that does not exist moves forward; an hour that comes twice takes the first one.
- 12 or 24 hours follow the language, or
hour12.minuteStepandsecondsset the fields.
Why this one
- No dependency, about 18 kB gzipped for every mode, zone and language.
- Values are ISO 8601 text. Each selection also gives two instants,
startandend, in the time zone. - 28 languages and right to left. Keyboard and screen readers.
- Your CSS and your colours, through CSS variables. Light and dark.
- The same picker in plain JavaScript, as a web component, in React and in Vue.