@grafana/ui
Version:
Grafana Components Library
24 lines (19 loc) • 662 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var data = require('@grafana/data');
;
const mapOptionToTimeRange = (option, timeZone) => {
return data.rangeUtil.convertRawToRange({ from: option.from, to: option.to }, timeZone);
};
const mapRangeToTimeOption = (range, timeZone) => {
const from = data.dateTimeFormat(range.from, { timeZone });
const to = data.dateTimeFormat(range.to, { timeZone });
return {
from,
to,
display: `${from} to ${to}`
};
};
exports.mapOptionToTimeRange = mapOptionToTimeRange;
exports.mapRangeToTimeOption = mapRangeToTimeOption;
//# sourceMappingURL=mapper.cjs.map