Date range selector

Two bounded dates chosen together, with the presets that cover most of what anyone actually asks for.

Refined portVue source: WildDateRangeSelector.vueReact component: WDateRangeSelector

Try it

Pick a preset or click two days, then Apply.

Reporting periodBore 12 · Emu Park
Includes today’s readings so far.
{ from: '2026-08-30', to: '2026-09-28', preset: 'last_30days' }
Size
Months
Presets
Max 31 days
Future days
Error
Disabled
<WDateRangeSelector
  value={period}
  onChange={setPeriod}
  label="Reporting period"
  hint="Bore 12 · Emu Park"
  size="sm"
  max={today}
/>

When to use

  • Use it to set a reporting or export period.
  • Keep the presets on for common periods.
Don’t use it

Anatomy

A field showing the period, and a panel of presets, months and footer.

a preset
a custom range
A preset shows its name; a custom range, its day count.
Last 7 days
Last 30 days
Last 60 days
Last 90 days
This month
Last month
Last 2 months
Last 3 months
Custom
August 2026
Mo
Tu
We
Th
Fr
Sa
Su
September 2026
Mo
Tu
We
Th
Fr
Sa
Su
30 Aug – 28 Sep 2026 · 30 days

Selection

Click a start, then an end; the band follows the pointer.

start chosen, end previewed
range set
one day
today
today in a range
hover
keyboard focus
unavailable
4 to 9 September
The band rounds off at each week and month end.

Presets

A preset keeps its id, so a saved report keeps rolling forward.

PresetCovers
Last 7, 30, 60 or 90 daysUp to and including today.
This monthThe 1st to today.
Last month, 2 or 3 monthsWhole months before this one.

Limits

maxDays caps the range; here, 31 days. Days and presets past it grey out.

Last 7 days
Last 30 days
Last 60 days
Last 90 days
This month
Last month
Last 2 months
Last 3 months
Custom
August 2026
Mo
Tu
We
Th
Fr
Sa
Su
September 2026
Mo
Tu
We
Th
Fr
Sa
Su
From 10 Sep 2026 · choose an end date, up to 31 days

Sizes and states

sm · preset
lg · custom range
empty
across a year
Locked while readings load.
disabled
Choose 31 days or fewer.
error

In context

View readings
Logger
Bore 12 · Emu Park
Period

Content

  • State a limit in the hint: “Up to 31 days”.
  • Say what to change in the error: “Choose 31 days or fewer.”

Accessibility

Days read their full date and place in the range.

KeyWhat it does
Enter / Space / ↑ / ↓On the field, opens the panel.
↑ / ↓Moves through presets; ← / → in a row.
EnterOn a preset, applies it; on Custom, moves to the days.
Enter / SpaceOn a day, sets the start, then the end.
Arrow keysOn the days, a day or a week.
Home / EndFirst or last preset; week start or end.
Page Up / DownA month; with Shift, a year.
TabStays in the panel.
EscapeCloses without changes.

Props

PropTypeDefaultDescription
value / defaultValue{ from, to, preset } | null{ preset: 'last_30days' }YYYY-MM-DD dates; a preset id wins.
onChange(range) => void—Fires when a range is applied.
presets{ id, label, range }[] | falsethe eightfalse hides the list.
todaystringtodayWhat presets count from.
min / maxstring—First and last usable days.
maxDaysnumber—Longest range, both ends counted.
months1 | 22Drops to one without room.
weekStartsOn0 | 111 is Monday, 0 is Sunday.
label / hint / helpstring—Name, side note, guidance below.
errorboolean | stringfalseA string shows below.
size'sm' | 'lg''sm'36 or 44px high.
align'start' | 'end''start'Field edge the panel aligns to.
placeholderstring'Choose a period'Shown when empty.
disabledbooleanfalseKeeps the field shut.
ariaLabelstring—Names the field without a label.
widthnumber | string300Field width.

Tokens

TokenValueWhere it lands
--global-blue-1000#1877F2Range ends and focus ring.
--global-blue-1100#0C296ABand ink, today, hovered ends.
--global-blue-100 / -200 / -300#EBFAFF / #D6F4FF / #BDEDFFPreviewed band; band and chosen preset; hover.
--global-neutral-grey-1100 / -1300#2D2B32 / #0A090BField value, days, presets; months, hover.
--global-neutral-grey-1000#4F4D55Placeholder, weekdays, counts, hint.
--global-neutral-grey-600#DCDCDEField border.
--global-red-800#E12121Field border on error.
--global-neutral-grey-700 / -900#C9C9CC / #7F7D83Unavailable days; inside the band.
--global-neutral-grey-300#F1F1F1Hover fills.
--global-neutral-grey-400 / -500#ECECED / #E6E6E6Dividers; the panel border.
--radius-lg / -xl8px / 12pxDay cells; the panel.
--shadow-dropdown0 4px 12px …The panel.