Date range picker

A period, typed or picked. Type both ends into the field, or open two months side by side with shortcuts beside them.

Example

Pick a start, then an end. Hovering shows the range on the way.

from '' to ''

<DateRangePicker
	bind:from
	bind:to
	presets={[lastDays(7), lastDays(30), thisMonth(), lastMonth(), thisYear()]}
/>

Rules

  • Both ends can be typed, and either can be left empty for an open-ended period.
  • Pick the shortcuts for the view: recency for a log, months for a report. Build them from the shared presets so a period is called the same everywhere.
  • Two months side by side from md; one on a phone.