search for: datehelper

Displaying 20 results from an estimated 41 matches for "datehelper".

2008 May 20
2
DateHelpers .. don' display.. ?
HI I don''t understand what happen .. if I use the script/console : >> include ActionView::Helpers::DateHelper => Object >> include GLoc => Object >> time_ago_in_words(Time.now, include_seconds = false) => "moins d''une minute" I get the correct answer.. but I I write in my view <%= time_ago_in_words(Time.now, include_seconds = false) -%> I get an error :w...
2006 Sep 12
1
DateHelper doesn't handle MonthDays?
I was looking at using the date helper functions for inputing a date for some records, and was highly disappointed to see that they will allow the entry of an invalid date such as Sept 31. It sure would be nice to see the days available change based on the month selected so the user cannot enter an invalid date that must later be reentered. Does anyone know of a plugin or if anyone has
2006 May 03
2
Using a helper within another helper?
...I''m doing: from the view: <%= format_planned_start_date @plan, ''plan'', ''planned_to_start_on'', ''Planned Start Date'' %> and from my helper: require ''date'' module HtmlHelper helper :date_helper include DateHelper def format_planned_start_date(obj, obj_name, field_name, label) text = "<tr><td valign=\"top\"><label for=\"#{obj_name}_#{field_name}\">" text += "</label></td>\n" if obj[field_name].nil? or DateTime.now < obj[...
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....
2006 Oct 22
3
Date Helpers?
Does anyone have any ideas off the top of there head how to easily construct a date helper as one would see in Rails? Thanks, Michael Gorsuch http://www.styledbits.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20061022/7dda5a52/attachment.html
2006 Jan 07
4
set date with date_select
when retreiving a date from a DATETIME field in a database, is there a way to set the date to the value of the DB in the view? It seems to always default to the current date... if I have a field called birthdate in the users table and i do @user = User.find(@params[:id]) in my view i have a <%= date_select ''birthdate'',''user'' %> but dont know how to
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/.
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
...th minimal changes and code? Can I overwrite the methods at runtime by using some Ruby override tricks? Should I? I''m still a bit new to the Ruby/Rails game, but I could see this being a bit of a pain since there is the ActionView class which has a Helpers Module within which there is a DateHelper module within which the date_select function is defined and which instantiates and InstanceTag class which has the to_select_tag function which I need to change. I supposed I could add javascript to my pages to insert the value later or just re-write the date_select function altogether, but I like...
2008 Jun 09
3
Rails 2.1 and ddatetime_select
I''ve updated to 2.1 and am continuing to have issues with datetime_select helpers which worked fine previously. Example: <% form_remote_tag(:url => { :controller => ''notes'', :action => :add_booking_note_ajax, :id => @booking},
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 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
2005 Dec 01
0
Problem using a date helper
Hi, I''m having trouble getting a date helper working. I was pointed to this by Sean Allen, and it resides at http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes It''s meant to fix the bug in Rails which doesn''t allow datetime_select to properly discard the year. So, I''m trying to use the helper''s time_select function. date_helper.rb is in my helpers directory. In my controller, it''s included with "he...
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 Aug 04
5
Creating new record from a form? (stringify_keys! error)
Appologies if this has been covered, But it seems the search is busted. I have a simple model object "Biostat" which I am trying to add a new record to. this is the form: <%= form_remote_tag( :update=>''statsTable'', :url=>{:action=>''new''}, :html=> {:action=>''new'',
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
2006 Dec 14
12
Saving dates
Hi having trouble saving dates in my form i have the following in the view <%= date_select("details", "open_date") %> and i have @exhibition.open_date = params[:details][:open_date] and then @exhibition.save All the other values form (not seen here) get saved but not the dates. What am i doing wrong ? -- Posted via http://www.ruby-forum.com/.
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 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a time input for an ActiveRecord field of type :time. I just want an hours input and a minuites input. I can get these with time_select helper using :field_name and :prefix but it gives both hours and miniutes the same name. <%= select_time(Time.now, :prefix => "search&q...
2006 Jul 07
3
calculate number of months difference between two dates
hi, Is there an easy way of calculating the difference in months between two dates in a controller. thanks -- Posted via http://www.ruby-forum.com/.
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/.