Amit Ambardekar
2010-Dec-15 19:07 UTC
distance_of_time_in_words shows {{count}} days instead of showing actual days
I have following code in view <% if @next_topic %> Time to show next topic <%= distance_of_time_in_words(Time.now.utc, @next_topic.time_to_show.utc) %> <hr /> <% end %> Output: Time to show next topic {{count}} days -------------------- time_to_show has following value Mon, 20 Dec 2010 12:38:00 UTC +00:00 @next_topic comes from database. I am using SQLITE. I am using Rails 2.3.8 I am using default settings for rest. I have tried many things but failed. Thanks Amit -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Dec-16 15:39 UTC
Re: distance_of_time_in_words shows {{count}} days instead of showing actual days
On 15 December 2010 19:07, Amit Ambardekar <amitamb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have following code in view > > <% if @next_topic %> > Time to show next topic <%= distance_of_time_in_words(Time.now.utc, > @next_topic.time_to_show.utc) %> > <hr /> > <% end %> > > Output: > > Time to show next topic {{count}} daysAre you using internationalisation? If so then it could be an issue there. Google for time to show in words rails count produced some possibilities including http://stackoverflow.com/questions/4330403/time-ago-in-words-in-count-days Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jonathan Rochkind
2011-Jan-20 17:49 UTC
Re: distance_of_time_in_words shows {{count}} days instead of showing actual days
Colin Law wrote in post #968871:> On 15 December 2010 19:07, Amit Ambardekar <amitamb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Time to show next topic {{count}} days > Are you using internationalisation? If so then it could be an issue > there. > > Google for > time to show in words rails count > produced some possibilities including > http://stackoverflow.com/questions/4330403/time-ago-in-words-in-count-days > > ColinFrom way back, I''m still having this problem. With rails 2.3.5 and ruby 1.8.7. The problem does NOT appear in ruby 1.8.6, only 1.8.7. It may be fixed in future versions of Rails, but future 2.3.x have OTHER bugs I don''t want, and I don''t have time to do the complete upgrade to 3.x yet. Very annoying! If anyone sees this and has any more info on it, please do let me know. Otherwise maybe I''ll just have to downgrade to 1.8.6 again. I upped to 1.8.7 because I had been reading people berating those who had stuck at 1.8.6 instead of at least staying current in 1.8.x -- but this is not the only bug or weird thing I''ve run into with Rails 2.x and 1.8.7 so far. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2011-Jan-20 18:19 UTC
Re: distance_of_time_in_words shows {{count}} days instead of showing actual days
Jonathan Rochkind wrote in post #976328:> Colin Law wrote in post #968871: >> On 15 December 2010 19:07, Amit Ambardekar <amitamb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> Time to show next topic {{count}} days >> Are you using internationalisation? If so then it could be an issue >> there. >> >> Google for >> time to show in words rails count >> produced some possibilities including >> http://stackoverflow.com/questions/4330403/time-ago-in-words-in-count-days >> >> Colin > > From way back, I''m still having this problem. With rails 2.3.5 and ruby > 1.8.7. > > The problem does NOT appear in ruby 1.8.6, only 1.8.7.I didn''t think Rails 2.3 was compatible with Ruby 1.8.6.> > It may be fixed in future versions of Rails, but future 2.3.x have OTHER > bugs I don''t want,2.3.10 fixes all bugs and security holes AFAIK -- and there *are* security holes, so you really should give it a try. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Walter Lee Davis
2011-Jan-20 18:29 UTC
Re: Re: distance_of_time_in_words shows {{count}} days instead of showing actual days
On Jan 20, 2011, at 1:19 PM, Marnen Laibow-Koser wrote:> 2.3.10 fixes all bugs and security holes AFAIK -- and there *are* > security holes, so you really should give it a try.I found the differences between 2.3.5 and 2.3.10 fairly minor, but my apps are all pretty small. Mostly it had to do with versions of various gems, and in my case the drive toward .10 was encouraged by new features I needed in a gem (vestal_versions), and the newer version of that gem only working under 1.8.7, which in turn drove me to 2.3.8, and then to 2.3.10 when all the foofaw about security raised its ugly head. Walter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.