min and max between a ZonedDateTime and a LaxZonedDateTime works admirably well in almost all situations:
julia> dt = ZonedDateTime(2016, 11, 6, winnipeg)
2016-11-06T00:00:00-05:00
julia> lzdt = LaxZonedDateTime(DateTime(2016, 11, 6, 1), winnipeg)
2016-11-06T01:00:00-AMB
julia> min(lzdt, dt)
2016-11-06T00:00:00-05:00
julia> max(dt, lzdt)
2016-11-06T01:00:00-AMB
julia> dt = ZonedDateTime(2016, 11, 6, 2, winnipeg)
2016-11-06T02:00:00-06:00
julia> min(lzdt, dt)
2016-11-06T01:00:00-AMB
julia> max(dt, lzdt)
2016-11-06T02:00:00-06:00
That's great! However...
julia> dt = ZonedDateTime(2016, 11, 6, 1, 30, winnipeg, 2)
2016-11-06T01:30:00-06:00
julia> lzdt = LaxZonedDateTime(DateTime(2016, 11, 6, 1), winnipeg)
2016-11-06T01:00:00-AMB
julia> min(dt, lzdt)
2016-11-06T01:00:00-AMB
julia> max(dt, lzdt)
2016-11-06T01:30:00-06:00
When the LaxZonedDateTime is ambiguous, it appears that min(dt::ZonedDateTime, lzdt::LaxZonedDateTime) will always return lzdt (provided dt is within the same period of potential ambiguity) and max will always return dt, even in the above case where it is impossible for lzdt to be less than dt.
Honestly I'm not sure this worth fixing. But it is certainly worth being aware of.
minandmaxbetween aZonedDateTimeand aLaxZonedDateTimeworks admirably well in almost all situations:That's great! However...
When the
LaxZonedDateTimeis ambiguous, it appears thatmin(dt::ZonedDateTime, lzdt::LaxZonedDateTime)will always returnlzdt(provideddtis within the same period of potential ambiguity) andmaxwill always returndt, even in the above case where it is impossible forlzdtto be less thandt.Honestly I'm not sure this worth fixing. But it is certainly worth being aware of.