From 546e10aa59b3d9ea24b9daeff81c67009aa30ff4 Mon Sep 17 00:00:00 2001 From: Kyle Krueger Date: Mon, 4 Nov 2019 11:14:56 +0100 Subject: [PATCH 1/2] Add last 14, 30, 60, and 90 days to DRP.js Date Range Parameter (DRP) --- .../services/parameters/DateRangeParameter.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/app/services/parameters/DateRangeParameter.js b/client/app/services/parameters/DateRangeParameter.js index dce8900283..72b4f799bb 100644 --- a/client/app/services/parameters/DateRangeParameter.js +++ b/client/app/services/parameters/DateRangeParameter.js @@ -48,6 +48,22 @@ const DYNAMIC_DATE_RANGES = { name: 'Last 7 days', value: () => [moment().subtract(7, 'days'), moment()], }, + last_14_days: { + name: 'Last 14 days', + value: () => [moment().subtract(14, 'days'), moment()], + }, + last_30_days: { + name: 'Last 30 days', + value: () => [moment().subtract(30, 'days'), moment()], + }, + last_60_days: { + name: 'Last 60 days', + value: () => [moment().subtract(60, 'days'), moment()], + }, + last_90_days: { + name: 'Last 90 days', + value: () => [moment().subtract(90, 'days'), moment()], + }, }; export const DynamicDateRangeType = PropTypes.oneOf(values(DYNAMIC_DATE_RANGES)); From ae2739cd7cd24b2a4b72e370b39e8e1f033ff8eb Mon Sep 17 00:00:00 2001 From: Kyle Krueger Date: Mon, 4 Nov 2019 11:21:03 +0100 Subject: [PATCH 2/2] Add last 14, 30, 60, and 60 day params to DRP.jsx DateRangeParameters (DRP) --- .../dynamic-parameters/DateRangeParameter.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/app/components/dynamic-parameters/DateRangeParameter.jsx b/client/app/components/dynamic-parameters/DateRangeParameter.jsx index 8c6a86d865..a61684ab89 100644 --- a/client/app/components/dynamic-parameters/DateRangeParameter.jsx +++ b/client/app/components/dynamic-parameters/DateRangeParameter.jsx @@ -34,6 +34,18 @@ const DYNAMIC_DATE_OPTIONS = [ { name: 'Last 7 days', value: getDynamicDateRangeFromString('d_last_7_days'), label: () => getDynamicDateRangeFromString('d_last_7_days').value()[0].format('MMM D') + ' - Today' }, + { name: 'Last 14 days', + value: getDynamicDateRangeFromString('d_last_14_days'), + label: () => getDynamicDateRangeFromString('d_last_14_days').value()[0].format('MMM D') + ' - Today' }, + { name: 'Last 30 days', + value: getDynamicDateRangeFromString('d_last_30_days'), + label: () => getDynamicDateRangeFromString('d_last_30_days').value()[0].format('MMM D') + ' - Today' }, + { name: 'Last 60 days', + value: getDynamicDateRangeFromString('d_last_60_days'), + label: () => getDynamicDateRangeFromString('d_last_60_days').value()[0].format('MMM D') + ' - Today' }, + { name: 'Last 90 days', + value: getDynamicDateRangeFromString('d_last_90_days'), + label: () => getDynamicDateRangeFromString('d_last_90_days').value()[0].format('MMM D') + ' - Today' }, ]; const DYNAMIC_DATETIME_OPTIONS = [