diff --git a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.tsx b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.tsx index 939ac33c704..02f7945ceb5 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.tsx @@ -18,6 +18,7 @@ import { import { Field } from '../../Forms/Field'; import { getInputStyles, Input } from '../../Input/Input'; import { Icon } from '../../Icon/Icon'; +import { Tooltip } from '../../Tooltip/Tooltip'; /** * @internal @@ -115,14 +116,13 @@ export function RelativeTimeRangePicker(props: RelativeTimeRangePickerProps): Re
- Specify time range -
- Specify a relative time range, for more information see{' '} - - docs - - . -
+ + } placement="bottom" theme="info"> +
+ Specify time range +
+
+
{ + const styles = useStyles2(toolTipStyles); + return ( + <> +
+ Supported formats: now-[digit]s/m/h/d/w +
+
Example: to select a time range from 10 minutes ago to now
+ From: now-10m To: now +
+ For more information see{' '} + + docs + + . +
+ + ); +}; + +const toolTipStyles = (theme: GrafanaTheme2) => ({ + supported: css` + margin-bottom: ${theme.spacing(1)}; + `, + tooltip: css` + margin: 0; + `, + link: css` + margin-top: ${theme.spacing(1)}; + `, +}); + const getStyles = (fromError?: string, toError?: string) => (theme: GrafanaTheme2) => { const inputStyles = getInputStyles({ theme, invalid: false }); const bodyMinimumHeight = 250;