similar to: DateHelpers .. don' display.. ?

Displaying 20 results from an estimated 1000 matches similar to: "DateHelpers .. don' display.. ?"

2007 Feb 21
2
date helper bug?
I''ve found an issue when trying to use the time_ago_in_words and distance_of_time_in_words from action view''s date_helper.rb Using SQL Server, I have a datetime column that gets returned as: "2007/02/21 09:54:00". When I pass this to time_ago_in_words (which just passes on to distance_of_time_in_words) it miscalculates the difference as "9 hours" (...um yeah,
2007 Jul 31
11
helper spec not finding rails core helpers
Hi, My helper specs were going ok until I added a call to a rails DateHelper method in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574 The helper runs fine from my view templates, just dies in the spec test. I boiled my question down to a simple (not too useful) example. I''m not sure what I''m missing. #
2013 Jan 02
4
distance_of_time_in_words_to_now
Hi There, As I have learned the hard way, let me discuss my question, idea or feature here before doing actual work on it... distance_of_time_in_words_to_now() seems to be unable to tell if this distance is in the future or in the past. I''d really like to see ''in 5 days'' or ''5 days ago'' depending on, well, if it was 5 days ago or will be in 5
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example <%= submit_tag''Login'', :or => link_to_function(''forgotten password'', "$(''reset-password'').toggle();") %> I understand the link_to_function, but what is this :or parameter used for ? the link doesn''t appear, so it cannot be used... thanks for your lights kad --
2006 Sep 12
1
Less verbose than time_ago_in_words method?
I''m trying to keep a Last Modified column in my record lists a fixed width and as narrow as possible. <td><%=time_ago_in_words record.updated_at%></td> However, making room for certain values like "less than a minute" force me to make the column twice as wide than, say, "12 hours" or "10 days". I would prefer "0
2010 Sep 07
2
Help on formatting some HAML
I wondered if anyone could help me with turning the following in ERB into HAML. I''m VERY new with HAML: ---- <div class="block-element span-7 colborder"> <span class="rightside blue-hue no_decor"><%= link_to "New Order", new_order_path, :remote => true %></span> <h3>Today''s Activity</h3> <hr>
2006 Aug 17
4
using time_ago_in_words() in a controller?
I''m getting this error when I try to update a list using ajax after submitting some data: undefined method `time_ago_in_words'' for #<IdeaController:0x3a38ae8> the LOC is this: render_text "<li>" + @params[:idea][:title] + "<br />by " + @params[:idea][:author] + " | " & time_ago_in_words(Time.now) & " ago | " +
2006 May 10
3
formatted date down-counter - help!
I''d like to have a count down to a certain date, but display it in words, such as "123 days away" or something. I''m aware of the function "distance_of_time_in_words_to_now()", which will display "about 6 hours" or "12 days" or something like that, but how can I get it to reverse? Pass it a date for future reference, then it will error
2008 Oct 11
1
Re: time_ago_in_words is off by a day
Look at your 1.day.from_now and see if it''s like this: Sun, 12 Oct 2008 02:45:42 UTC +00:00 If you also have the "UTC +00:00", it means that you timezone is the GMT (and I think that it isn''t your real timezone). For example, my timezone is 3 hours after the GMT, so the right timezone would be something like this: Sat Oct 11 23:48:41 -0300 2008 At your
2006 May 24
0
distance_of_time_in_german_words
Hiall, This could be useful for those of you producing websites in the german language. Basically I copied the definition of the rails builtin distance_of_time_in_words and extracted another method german_words_for_distance_in_seconds. Just put these e.g. into module ApplicationHelper and you can use it in all views. def distance_of_time_in_german_words(from_time, to_time = 0, include_seconds
2007 Jan 13
6
nice date function
Hi: you know the way the google and this forum presents dates? How it''s measure from the current date/time and presents nicely as "39 minutes ago", 2 days ago, etc.? Has anyone done a gem or other library object that I can get to do those types of dates? Thanks so much in advance! Mike -- Posted via http://www.ruby-forum.com/.
2008 Feb 03
4
Testing helper/view methods from script/console
Hi, Is it possible to test helper/view methods from script/console. I want to test the output of methods like distance_of_time_in_words. But it won''t let me from the console. What am I missing? TIA Luke -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on
2008 Apr 04
0
Date.to_s format with time_ago_in_words
Hello, Following this post''s instructions (http://railspikes.com/tags/date) I''m trying to define a Date format like this: ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update(:date_ago => lambda { |date| date.strftime(''%a, %d %b, %I:%M%p'') + '' ('' + time_ago_in_words(date) + '')'' } ) But it keeps giving
2006 Aug 01
2
Date length in english plugin/built in?
Is there a plugin or built in function for converting a date interval into the English equivalent? For example, "So and so posted this 45 minutes ago". -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060801/e33b04d1/attachment.html
2006 Jun 18
2
convert timespan to verbose description
Hi, I always see RoR pages showing the elapsed time like that ''Published 3 days, 23 hour and 5 minutes ago'' ''Published less than 3 minutes ago'' I guess this conversion can be done using a Rails function, however I can''t find it. Does somebody know its name?? Thanks a lot Peter
2006 Aug 13
0
Announcement: Really simple localization plugin
I needed something simpler than Globalize and GLoc to localize my Rails application into Danish. I packed it into this plugin. Feel free to use it. Languages available: Spanish, German, Swedish, Danish, and ("Swedish Chef" for the fun of it) Plugin available at http://visitjesper.homeip.net/plugins/ IMPORTANT: Plugin directory likely to move to more appropriate location anytime The
2006 Aug 23
11
i18n friendly, plugable Rails Core
In my work with a simple localization plugin, i''m running into a lot of places in the Rails core, where text and other localization specific information is hardcoded. I''ve included some examples in the bottom of this post. It''s hard for an outsider to know, if the hardcoded values are a result of inconsistency in code, or "by design". I hope that we can have
2012 Oct 31
5
css background not showing
Hi all, for some reason adding the following is doing nothing... .post.hover { background: FAFAFA; I''ve got this in my posts.js coffee file $ -> $(''.post'').hover (event) -> $(this).toggleClass("hover") and my index is <% @posts.each do |post| %> <div class="post"> <strong><%= post.title %></strong>
2008 Jul 04
4
select_datetime // datetime_select
Hi I have 2 question for you guys, 1. Which is the difference between this two methods? (select_datetime, datetime_select) 2. How I assign the selected date-time values, to an specific variable or array using select_datetime I know do it using datetime_select(''object'',''method'') I aprecciate your attention. Thanks PD: Sorry about my english.
2006 Jul 20
1
Outputting date as "1 day ago" or "53 minutes ago"
When printing out the results of my "updated_at" field, I''d like to be able to print it as "Updated 5 days ago" instead of "Updated on 7/14/06." I''ve seen many blogs do this, is there an easy way to do it through rails / ruby? -- Posted via http://www.ruby-forum.com/.