Fix DateTime comparison with DateTime::Infinity object

This fix allows a `Range` to include `DateTime` and `DateTime::Infinity` objects.

Closes #8178