From d0f94dcdf1f8c8bedd503d1f140ef3b027e27b65 Mon Sep 17 00:00:00 2001 From: MarkLark86 Date: Mon, 20 Jan 2020 13:18:13 +1100 Subject: [PATCH] [SDESK-4695] (fix): Histogram aggregations failing for relative dates (#114) These include the following range types: * yesterday * last week * last month * last year --- server/analytics/base_report/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/analytics/base_report/__init__.py b/server/analytics/base_report/__init__.py index 8c0a40150..31ca8fffd 100644 --- a/server/analytics/base_report/__init__.py +++ b/server/analytics/base_report/__init__.py @@ -100,7 +100,7 @@ def _get_histogram_aggregation(self, interval, args, aggregations): # starting day of the week, based on app.config['START_OF_WEEK'] offset = 0 if interval != 'week' else get_weekstart_offset_hr() - if lt == 'now': + if lt.startswith('now'): extended_bounds = { 'max': relative_to_absolute_datetime(lt, '%Y-%m-%dT%H:%M:%S'), 'min': relative_to_absolute_datetime(gte, '%Y-%m-%dT%H:%M:%S')