From 14d9c7c3765cefcadef8ed02348758702cc96cd8 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 25 Oct 2023 20:18:13 -0400 Subject: [PATCH] fixup to #51743, timetype subtraction Restores the method whose removal was probably causing problems. --- stdlib/Dates/src/arithmetic.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/Dates/src/arithmetic.jl b/stdlib/Dates/src/arithmetic.jl index 23a76f5ed75d6..b379747c5f9e9 100644 --- a/stdlib/Dates/src/arithmetic.jl +++ b/stdlib/Dates/src/arithmetic.jl @@ -6,8 +6,7 @@ # TimeType arithmetic (+)(x::TimeType) = x -(-)(x::Date, y::Date) = x.instant - y.instant -(-)(x::Time, y::Time) = x.instant - y.instant +(-)(x::T, y::T) where {T<:TimeType} = x.instant - y.instant (-)(x::DateTime, y::DateTime) = x.instant - y.instant (-)(x::AbstractDateTime, y::AbstractDateTime) = -(promote(x, y)...)