StealThis .dev

Date Range Picker

A dual-calendar date range picker with hover preview, preset ranges, and keyboard navigation. Used for booking, analytics date filters, and reporting.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

Date Range Picker

A polished dual-calendar date range picker for SaaS dashboards and booking interfaces. Click a start date then hover to preview the range in real time before confirming the end date. Preset range shortcuts cover common analytics windows, and keyboard navigation with arrow keys + Enter makes it fully accessible without a mouse.

Features

  • Two side-by-side month calendars with independent navigation
  • Real-time hover preview between start and end selection
  • 8 preset range shortcuts (Today, Last 7 Days, This Month, etc.)
  • Disabled past dates toggle and out-of-month day dimming
  • Today marker, selected range highlight, and accent end-caps
  • Footer showing selected range, day count, Cancel and Apply buttons
  • Keyboard navigation: arrow keys to move focus, Enter to select, Escape to close