Skip to content

Commit

Permalink
use user provided end date for x-axis calc (opensearch-project#584)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan committed May 30, 2023
1 parent 1373523 commit c280bad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/pages/Overview/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c280bad

Please sign in to comment.