Skip to content

Date, time & datetime #142

kuraga opened this Issue Mar 14, 2012 · 1 comment

2 participants

kuraga commented Mar 14, 2012

Now the type of object for localization is determined by line:

# lib/i18n/backend/base.rb, line 53
type = object.respond_to?(:sec) ? 'time' : 'date'

But why don't you determine DateTime? I suggest something like:

type = case object.class
  when Time
  when Date
  when DateTime
    raise ArgumentError

It's helpfull very much - we haven't think about the DateTime type!

knapo commented Nov 25, 2012

I aggree that that condition is not the best way of handling it, but in my opinion Time and DateTime formats ( should be the same, as from UI point of user there is no difference between Time and DateTime . Did you meet any case when you needed different localizing for DateTime and Time ?

@kuraga kuraga closed this Aug 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.