Commit be157b84 by Ivana Huckova Committed by GitHub

Update raw range only if isMathString (#23122)

parent 16306cca
......@@ -40,25 +40,16 @@ export const mapStringsToTimeRange = (from: string, to: string, roundup?: boolea
const fromDate = stringToDateTimeType(from, roundup, timeZone);
const toDate = stringToDateTimeType(to, roundup, timeZone);
if (dateMath.isMathString(from) || dateMath.isMathString(to)) {
return {
from: fromDate,
to: toDate,
raw: {
from,
to,
},
};
}
return {
const timeRangeObject: any = {
from: fromDate,
to: toDate,
raw: {
from: fromDate,
to: toDate,
from: dateMath.isMathString(from) ? from : fromDate,
to: dateMath.isMathString(to) ? to : toDate,
},
};
return timeRangeObject;
};
const stringToDateTime = (value: string | DateTime, roundUp?: boolean, timeZone?: TimeZone): DateTime => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment