import { parseDuration } from '../../common/parse_duration' ; param dateString returns export function parseIsoOrRelativeDate ( dateString ) { const epochMillis = Date . parse ( dateString ) ; if ( ! isNaN ( epochMillis ) ) return new Date ( epochMillis ) ; let millis ; try { millis = parseDuration ( dateString ) ; } catch ( err ) { return ; } return new Date ( Date . now ( ) - millis ) ; }