search for: date_help

Displaying 19 results from an estimated 19 matches for "date_help".

Did you mean: data_help
2006 Jul 13
3
date_helper megapatch and MultiparameterAssignmentErrors
Hello all, There''s a great patch in trac that fixes a lof of issues with the date helpers. I''m afraid it hasn''t had any attention yet. http://dev.rubyonrails.org/ticket/3811 This fixes all the little date_helper problems, except one: When you choose an invalid date ActiveRecord throws an ActiveRecord::MultiparameterAssignmentErrors. This used to work in 1.0, Februari 30th would be translated to March 2nd. I have no clue on how this could be fixed since the Error is thrown deep inside. I was go...
2008 Jun 26
2
Problem with date_select after Rails 2.1 upgrade
...2)) on line #8 of entries/_dates_form.haml: 8: = date_select( ''context'', ''start_date'', {:start_year => 2007, :order => [:month, :day, :year], :use_short_month => true, :include_blank => false}) vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb: 655:in `select_year'' vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb: 655:in `send'' vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb: 655:in `date_or_time_select'' .... ---- If I dig into DateHelper with the debugger, this ap...
2006 May 03
2
Using a helper within another helper?
...ive an example of what 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...
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2006 Mar 15
1
Strange behaviour of dates
...p'', ''primary_date_of_birth'', :start_year => 1900 %> returns: Showing app/views/app/_edit.rhtml where line #36 raised: undefined method `year'' for "1993-02-05":String /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/ date_helper.rb:222:in `select_year'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/ date_helper.rb:275:in `to_date_select_tag_without_error_wrapping'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/ date_helper.rb:274:in `to_date_sele...
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, it was 10:54 when I tested this), wh...
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 10
14
Oracle Date type errors rails on edit
I have a table with "expires_on" a DATE field. "Show" and "Destroy" work, but "Edit" errors: /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:150:in `select_hour'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:149:in `select_hour'' It only happens when hour:minutes:seconds are all zeros. The edit interface allows all zeros when creating or updating. It seems that this...
2005 Mar 12
0
scaffolding issue
...al/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/form_helper.rb:236:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/form_helper.rb:236:in `value'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/date_helper.rb:246:in `to_datetime_select_tag_without_error_wrapping'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/active_record_helper.rb:173:in `to_datetime_select_tag'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/date_help...
2006 Dec 18
1
Bad merge of r5686 from trunk to 1.2-pre-release?
I do not closely follow the core source commits, but please bare with me. I will keep it short. Recently, changeset#5685 [1] caught my attention as I''ve been waiting for some date_helper love for a VERY long time. What bothered me is that when this changeset was merged into the 1.2- pre-release branch (at changeset#5686 [2]) a change to caching.rb crept in [3], which was not in the original patch. I didn''t notice a roll back in the revision log of caching.rb so I am...
2005 Nov 04
0
RE: Why class InstanceTag is defined at 4 different places inRails
...] On Behalf Of Neeraj Kumar Sent: Friday, November 04, 2005 4:31 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] Why class InstanceTag is defined at 4 different places inRails In Rails, the class InstanceTag is defined at 4 places: active_record_helper.rb date_helper.rb form_helper.rb form_options_helper.rb I have a need to overrite the def to_date_select_tag(options = {}) method of class InstanceTag defined in date_helper.rb . With little background in Ruby I am finding it difficult to achieve overwriting a method in an elegant way. Is it a goo...
2005 Dec 01
0
Problem using a date helper
...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 "helper :date" In my view, I have the code <%= time_select ''train'', ''stonybrook_at'' %> If I use the helper file as-is, when I try to load my view, I get the error &qu...
2006 Jan 23
11
mysql dates
does anyone know of a way to make the date_helper deal with mysql dates with 00 values in them? I have lots of dates that are like the following: 2005-04-00 2005-00-00 and I need to set null values in a date_select for elements that are 00. These are valid dates in mysql. In the absence of an immediate solution to the above, I''ve been...
2006 Jul 18
1
Auto-populating time portion of a datetime field from a form
I see that if I use the date_select helper in my view, then in the generated page, my selects are named obj[datetime_field(1i)] (and 2i and 3i for the other parts). These auto-populate the date portion of my datetime_field. I have another datetime field that I''m presenting the time from and I would like to use a similar scheme to autopopulate it. Currently, I''ve used the
2005 May 02
1
datetime_select and discard
ok so datetime_select if you use the discard options say { :discard_month => true } when you just do update_attributes on said object year would be correct month would be the hour date would be the minute so if you select year: 2005 hour: 12 minute: 13 the time object would go into the db as: ''2005-12-13 00:00:00'' so my question is how do i get the time object properly
2008 Mar 17
0
Nil dates in selct_date
Can one specify to date_select that a nil value is permitted and is the default value? Is it possible to add nil to the list of permitted values in a date_select call? The code in /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/date_helper.rb seems to treat nil as now. 654 def default_time_from_options(default) 655 case default 656 when nil 657 Time.now 658 when Date, Time 659 default I have a situation where a record may have a supersed...
2006 Mar 10
6
How do i apply a patch?
Hi, i have a patch to make instiki work with the latest version of ruby : as_clean_logger_rb-fixed.patch But i dont know how to apply it. Any ideas?? Thanks, Chris -- 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 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},