diff --git a/kibana-reports/public/components/report_definitions/report_settings/report_settings_constants.tsx b/kibana-reports/public/components/report_definitions/report_settings/report_settings_constants.tsx index f50c7d51..edad8b43 100644 --- a/kibana-reports/public/components/report_definitions/report_settings/report_settings_constants.tsx +++ b/kibana-reports/public/components/report_definitions/report_settings/report_settings_constants.tsx @@ -65,3 +65,26 @@ export const REPORT_SOURCE_TYPES = { visualization: 'Visualization', savedSearch: 'Saved search', }; + +export const commonTimeRanges = [ + { + start: 'now/d', + end: 'now', + label: 'Today so far' + }, + { + start: 'now/w', + end: 'now', + label: 'Week to date' + }, + { + start: 'now/M', + end: 'now', + label: 'Month to date' + }, + { + start: 'now/y', + end: 'now', + label: 'Year to date' + } +] \ No newline at end of file diff --git a/kibana-reports/public/components/report_definitions/report_settings/time_range.tsx b/kibana-reports/public/components/report_definitions/report_settings/time_range.tsx index badf2424..f5517731 100644 --- a/kibana-reports/public/components/report_definitions/report_settings/time_range.tsx +++ b/kibana-reports/public/components/report_definitions/report_settings/time_range.tsx @@ -22,6 +22,7 @@ import { EuiGlobalToastList, EuiSuperDatePicker, } from '@elastic/eui'; +import { commonTimeRanges } from './report_settings_constants'; export function TimeRangeSelect(props) { const { @@ -191,6 +192,7 @@ export function TimeRangeSelect(props) { setIsLoading(false); }; + return (
@@ -207,6 +209,7 @@ export function TimeRangeSelect(props) { end={end} onTimeChange={onTimeChange} showUpdateButton={false} + commonlyUsedRanges={commonTimeRanges} />