mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
Update raw range only if isMathString (#23122)
This commit is contained in:
parent
16306ccacb
commit
be157b8457
@ -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 => {
|
||||
|
Loading…
Reference in New Issue
Block a user