From a90d21c7a2f5853bf4fd0f33c27df0166bc44788 Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Tue, 30 May 2023 12:34:54 -0700 Subject: [PATCH] use user provided end date for x-axis calc (#584) Signed-off-by: Amardeepsingh Siglani (cherry picked from commit c280badc33805b07c19ee02d7838b47b7d2d5397) --- public/pages/Overview/utils/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/pages/Overview/utils/helpers.ts b/public/pages/Overview/utils/helpers.ts index b3307cfef..1c2a7eb5b 100644 --- a/public/pages/Overview/utils/helpers.ts +++ b/public/pages/Overview/utils/helpers.ts @@ -464,7 +464,9 @@ export const getDomainRange = ( if (timeUnit) { const timeUnitSize = timeUnit.match(/.*(seconds|minutes|hours|date|month|year)$/); if (timeUnitSize && timeUnitSize[1]) { - rangeEnd = `now+1${timeUnitSize[1][0]}`; + // `||` is the separator which the datemath's parse method will use to split the dates for + // the addition. + rangeEnd = `${range[1]}||+1${timeUnitSize[1][0]}`; } } const end: number = parseDateString(rangeEnd);