import dateMath from '@elastic/datemath' ; import { TimeRange } from '../../../../../common' ; export function toAbsoluteDates ( range ) { const fromDate = dateMath . parse ( range . from ) ; const toDate = dateMath . parse ( range . to , { roundUp : true } ) ; if ( ! fromDate || ! toDate ) { return ; } return { from : fromDate . toDate ( ) , to : toDate . toDate ( ) , } ; }