adding IntervalType enum instead of long if-else chain

This PR implements the suggested enum structure to replace the long if-else chain that was used to identify interval lengths. All the DateUtil tests are passing with this and it builds fine.