TimeWindowPicker

Molecule

Relative presets ("1h", "7d"), an optional custom "last N minutes / hours / days", calendar periods ("today", "previous month", optionally "so far"), an absolute UTC range, and the interval / aggregation / time zone that go with a window. Controlled: the value is a structural `TimeWindowValue`, nothing here knows about dashboards. Every label, period names included, is overridable through `messages`.

Default

Preview
{"mode":"relative","last":"24h"}
Code
<TimeWindowPicker value={win} onChange={setWin} />

Calendar periods, custom duration and time zone

Preview
{"mode":"calendar","period":"current.day","soFar":true}
Code
<TimeWindowPicker value={win} onChange={setWin} calendarPeriods={DEFAULT_CALENDAR_PERIODS} allowDuration showTimezone />

Presets only

Preview
{"mode":"relative","last":"24h"}
Code
<TimeWindowPicker value={win} onChange={setWin} presets={['1h', '24h', '7d']} allowAbsolute={false} showInterval={false} showAggregation={false} />
Sourcemodules/ui/TimeWindowPicker.tsx