Ruby on Rails Monday, April 30, 2012

Hi there,

I'm doing an own library to manage datetimes depending on locales, to
deal with the formats of datetimes. I actually overrides the default
assign methods to made strptime.

I've made the following:

http://ideone.com/PXYl8

something is wrong when trying to access on I18n.t, the scope is valid,
if I put a debugger outside that misterious loop it prints what is
expected...

console output:

1.9.3p125 :001 > User.datepicker_attributes :created_at
=> [:created_at]
1.9.3p125 :002 > User.new.created_at = "10/10/2012 10:12"
=> "10/10/2012 10:12"
debugger outside the loop.
(rdb:1) p I18n.t('time.datepicker_formats').values.first
"%d/%m/%Y %H:%M"
(rdb:1) p Time.strptime(date,
I18n.t('time.datepicker_formats').values.first)
2012-10-10 10:12:00 +0200



I'm a little stuck on that, any tip will be appreciated

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment