You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using Dates
julia> dt =DateTime(2018, 1, 1)
2018-01-01T00:00:00
julia> a = dt:Hour(1):dt +Hour(5);
julia> b = dt +Hour(2):Hour(1):dt +Hour(7);
julia>intersect(a,b)
ERROR: MethodError: no method matching rem(::Millisecond, ::Hour)
Closest candidates are:rem(::Any, ::Any, ::RoundingMode{:ToZero}) at math.jl:806rem(::Any, ::Any, ::RoundingMode{:Down}) at math.jl:807rem(::Any, ::Any, ::RoundingMode{:Up}) at math.jl:808...
Stacktrace:
[1] intersect(::StepRange{DateTime,Hour}, ::StepRange{DateTime,Hour}) at ./range.jl:807
[2] top-level scope at REPL[7]:1
julia>intersect(collect(a), b)
4-element Array{DateTime,1}:2018-01-01T02:00:002018-01-01T03:00:002018-01-01T04:00:002018-01-01T05:00:00
Note that the intersect function being called is from Base in both cases so if this issue is addressed by the Dates stdlib then this issue should also be addressed here.
With
StepRange{Int}
it works as expected:With
StepRange{<:AnchoredInterval}
it does not work:The following works but returns a
Vector
rather than aStepRange
:This is with julia 1.5.2 and Intervals 1.5.0
The text was updated successfully, but these errors were encountered: