import dateMath from '@elastic/datemath' ; import { TimeRange } from '../../../../common' ; export function validateTimeRange ( time ? ) { if ( ! time ) return false ; const momentDateFrom = dateMath . parse ( time . from ) ; const momentDateTo = dateMath . parse ( time . to ) ; return ! ! ( momentDateFrom && momentDateFrom . isValid ( ) && momentDateTo && momentDateTo . isValid ( ) ) ; }