Skip to content

[ji] make java.util.Date duck type some of Ruby's Time  #3801

@kares

Description

@kares

that would probably help some user confusion: #2049

currently Time auto-coerces to java.util.Date (e.g. with Java collections) and it stays that way :

require 'active_support/all'
1.second # 1 second
Time.now.beginning_of_day # works

list = java.util.ArrayList.new
list.add(1)
list.add(Time.now)

list.get(0).second # 1 second
list.get(1).beginning_of_day # undefined method `beginning_of_day' for #<Java::JavaUtil::Date:0x409986fe>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions