mirror of
https://github.com/grafana/grafana.git
synced 2025-02-03 20:21:01 -06:00
5bed54170e
* Split main reducer from item reducer * Move query related redux to separate file * Split more parts and tests * Fix import * Remove unused code * Update public/app/features/explore/state/datasource.ts Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com> * Add section comments * Rename ExploreItem to ExplorePane * Fix imports Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
19 lines
365 B
TypeScript
19 lines
365 B
TypeScript
import { isDateTime, RawTimeRange, TimeRange } from '@grafana/data';
|
|
|
|
export const toRawTimeRange = (range: TimeRange): RawTimeRange => {
|
|
let from = range.raw.from;
|
|
if (isDateTime(from)) {
|
|
from = from.valueOf().toString(10);
|
|
}
|
|
|
|
let to = range.raw.to;
|
|
if (isDateTime(to)) {
|
|
to = to.valueOf().toString(10);
|
|
}
|
|
|
|
return {
|
|
from,
|
|
to,
|
|
};
|
|
};
|