UNPKG

@grafana/ui

Version:
24 lines (19 loc) 662 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var data = require('@grafana/data'); "use strict"; 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