We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 406ba12 commit 32ed459Copy full SHA for 32ed459
stdlib/Dates/src/arithmetic.jl
@@ -7,7 +7,7 @@
7
# TimeType arithmetic
8
(+)(x::TimeType) = x
9
(-)(x::T, y::T) where {T<:TimeType} = x.instant - y.instant
10
-(-)(x::TimeType, y::TimeType) = -(promote(x, y)...)
+(-)(x::AbstractDateTime, y::AbstractDateTime) = -(promote(x, y)...)
11
12
# Date-Time arithmetic
13
"""
stdlib/Dates/test/arithmetic.jl
@@ -11,12 +11,6 @@ using Dates
@test Dates.CompoundPeriod(a - b) == Dates.Hour(12)
end
14
-@testset "TimeType arithmetic" begin
15
- a = Date(2023, 5, 1)
16
- b = DateTime(2023, 5, 2)
17
- @test b - a == Day(1)
18
-end
19
-
20
@testset "Wrapping arithmetic for Months" begin
21
# This ends up being trickier than expected because
22
# the user might do 2014-01-01 + Month(-14)
0 commit comments