ActionsLike0
Bug #15712
closedDateTime#=== should be defined and compare date and time instead of just the date
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-03-18 trunk 67296) [x86_64-darwin17]
Tags:
Description
DateTime#=== is inherited from Date#=== without overwriting the #=== method, this leads to DateTime#=== comparing only dates and ignore the time part.
DateTime.new(2001, 2, 3) === DateTime.new(2001, 2, 3, 12)
=> false
I think this is not the expected behavior but existing code might rely on this.
Date#===: https://ruby-doc.org/stdlib-2.1.9/libdoc/date/rdoc/Date.html#method-i-3D-3D-3D
Source: https://medium.com/@dvandersluis/an-rspec-time-issue-and-its-not-about-timezones-a89bbd167b86
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Status changed from Open to Feedback
Updated by jeremyevans0 (Jeremy Evans) over 4 years ago
- Status changed from Feedback to Closed
ActionsLike0