- A
- B
- D
- E
- F
- L
- M
- N
- P
- S
- T
- W
- Y
DAYS_INTO_WEEK | = | { :monday => 0, :tuesday => 1, :wednesday => 2, :thursday => 3, :friday => 4, :saturday => 5, :sunday => 6 } |
Returns a new date/time at the start of the month. DateTime objects will have a time set to 0:00.
Returns a new date/time at the start of the quarter. Example: 1st January, 1st July, 1st October. DateTime objects will have a time set to 0:00.
Returns a new date/time representing the start of this week on the given
day. Week is assumed to start on start_day
, default is
Date.beginning_of_week
or
config.beginning_of_week
when set. DateTime
objects have their time set to 0:00.
Return a new date/time at the beginning of the year. Example: 1st January. DateTime objects will have a time set to 0:00.
Returns a new date/time the specified number of days ago.
Returns a new date/time the specified number of days in the future.
Returns the number of days to the start of the week on the given day. Week
is assumed to start on start_day
, default is
Date.beginning_of_week
or
config.beginning_of_week
when set.
# File activesupport/lib/active_support/core_ext/date_and_time/calculations.rb, line 164 def days_to_week_start(start_day = Date.beginning_of_week) start_day_number = DAYS_INTO_WEEK[start_day] current_day_number = wday != 0 ? wday - 1 : 6 (current_day_number - start_day_number) % 7 end
Returns a new date/time representing the end of the month. DateTime objects will have a time set to 23:59:59.
Returns a new date/time at the end of the quarter. Example: 31st March, 30th June, 30th September. DateTime objects will have a time set to 23:59:59.
Returns a new date/time representing the end of this week on the given day.
Week is assumed to start on start_day
, default is
Date.beginning_of_week
or
config.beginning_of_week
when set. DateTime objects have their time set to
23:59:59.
Returns a new date/time representing the end of the year. DateTime objects will have a time set to 23:59:59.
Returns true if the date/time is in the future.
Returns Monday of this week assuming that week starts on Monday.
DateTime
objects have their time set to 0:00.
Returns a new date/time the specified number of months ago.
Returns a new date/time the specified number of months in the future.
Short-hand for #months_since(1).
Short-hand for #months_since(3)
Returns a new date/time representing the given day in the next week. The
given_day_in_next_week
defaults to the beginning of the week
which is determined by Date.beginning_of_week
or
config.beginning_of_week
when set. DateTime
objects have their time set to 0:00.
Short-hand for #years_since(1).
Returns true if the date/time is in the past.
Returns a new date/time representing the given day in the previous week.
Week is assumed to start on start_day
, default is
Date.beginning_of_week
or
config.beginning_of_week
when set. DateTime objects have their time set to 0:00.
Returns Sunday of this week assuming that week starts on Monday.
DateTime
objects have their time set to 23:59:59.
Returns true if the date/time is today.
Returns a new date/time representing tomorrow.
Returns a new date/time the specified number of weeks ago.
Returns a new date/time the specified number of weeks in the future.
Returns a new date/time the specified number of years ago.
Returns a new date/time the specified number of years in the future.