The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.mdx

37 lines
787 B

import { Story, Preview, ArgTypes } from '@storybook/blocks';
import { TimeRangeInput } from './TimeRangeInput';
# TimeRangeInput
A variant of `TimeRangePicker` for use in forms.
`dateTime(null)` can be used to provide empty time range value. The shape of the return value on input clear is:
```javascript
{
from: dateTime(null),
to: dateTime(null),
raw: {
from: dateTime(null),
to: dateTime(null),
},
};
```
`dateMath.isValid()` from `@grafana/data` can be used to check for a valid time range value.
### Usage
```jsx
import { TimeRangeInput } from '@grafana/ui';
<TimeRangeInput
value={timeRange}
onChange={(range) => console.log('range', range)}
onChangeTimeZone={(tz) => console.log('timezone', tz)}
/>;
```
### Props
<ArgTypes of={TimeRangeInput} />