Displaying 6 results from an estimated 6 matches for "end_of_month".
2006 Jan 26
1
end_of_month()
I noticed that
ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods.end_of_month()
returns a new Time with the time set to 00:00:00. I expected it to return
23:59:59.
Am I missing something? Should this be changed?
Scott
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour:
>> "19270412000000".to_date.methods
=> ["ns?", "mon", "ago", "end_of_month", "months_since",
"default_inspect", "minus_without_duration", ...
>> "19270412000000".to_date.class
=> Date
>> "19270412000000".class
=> String
>> String.to_date.methods
NoMethodError: undefined method `to_date''...
2006 Jun 08
2
how to add plugin to ActiveRecord
I''m trying to set a date field''s day to the last day of the month before
I save it. I can do this successfully now using this code:
class Account < ActiveRecord::Base
def before_save
self.exp_date = last_day_of_month(self.exp_date)
end
# Returns a Date object set to the last day of the current month
def last_day_of_month(date = Date.today)
next_month_str
2007 Nov 16
1
Missing methods patch for Time::Calculations
Time::Calculations provides methods like "end_of_month",
"beginning_of_year" and so on. But it lacks other related methods like
"end_of_week" and "end_of_year" that I think should be expected to be
there.
Here is a patch adding those methods: http://dev.rubyonrails.org/ticket/9312
+1''s?
Juanjo
--~--~------...
2011 Mar 14
0
Problems with viewing my calendar
...h1>
<div id="calendar">
<h2 id="month">
<%= link_to "<", :month =>
(@date.beginning_of_month-1).strftime("%Y/%m") %>
<%=h @date.strftime("%B %Y") %>
<%= link_to ">", :month => (@date.end_of_month+1).strftime("%Y/%m")
%>
</h2>
<% calendar_for(@visitors, :year => @date.year, :month => @date.month)
do |calendar| %>
<%= calendar.head(''Sonntag'', ''Montag'', ''Dienstag'', ''Mittwoch'',
'...
2008 Oct 14
4
replace_html not working
hallo, everyone
can anybody help me? i did add my code under ENGINES as a module in a
project. before the change , all worked . and the differenz between
both is only about application''s environment,
before is
Ruby version 1.8.6 (i486-linux)
RubyGems version 1.1.1
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2