Convert interval to a enum