mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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 fromDate = stringToDateTimeType(from, roundup, timeZone);
|
||||||
const toDate = stringToDateTimeType(to, roundup, timeZone);
|
const toDate = stringToDateTimeType(to, roundup, timeZone);
|
||||||
|
|
||||||
if (dateMath.isMathString(from) || dateMath.isMathString(to)) {
|
const timeRangeObject: any = {
|
||||||
return {
|
|
||||||
from: fromDate,
|
|
||||||
to: toDate,
|
|
||||||
raw: {
|
|
||||||
from,
|
|
||||||
to,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
from: fromDate,
|
from: fromDate,
|
||||||
to: toDate,
|
to: toDate,
|
||||||
raw: {
|
raw: {
|
||||||
from: fromDate,
|
from: dateMath.isMathString(from) ? from : fromDate,
|
||||||
to: toDate,
|
to: dateMath.isMathString(to) ? to : toDate,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return timeRangeObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
const stringToDateTime = (value: string | DateTime, roundUp?: boolean, timeZone?: TimeZone): DateTime => {
|
const stringToDateTime = (value: string | DateTime, roundUp?: boolean, timeZone?: TimeZone): DateTime => {
|
||||||
|
Loading…
Reference in New Issue
Block a user