aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/time
diff options
context:
space:
mode:
authorgregolsen <anotheroneman@yahoo.com>2011-11-07 13:26:56 +0200
committerXavier Noria <fxn@hashref.com>2011-11-25 12:02:49 -0800
commit7a33a005d732e80f5a6832b67df6dec5a6faaa1e (patch)
tree901e1460ba2f48f1010c8f2f699f95072e2244bf /activesupport/lib/active_support/core_ext/time
parent3f1a4c3415113f2d365eb1a5531757699afec605 (diff)
downloadrails-7a33a005d732e80f5a6832b67df6dec5a6faaa1e.tar.gz
rails-7a33a005d732e80f5a6832b67df6dec5a6faaa1e.tar.bz2
rails-7a33a005d732e80f5a6832b67df6dec5a6faaa1e.zip
API docstrings updated with default value info
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time')
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index 154ba78646..2cc5c82265 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -161,7 +161,7 @@ class Time
months_since(1)
end
- # Returns number of days to start of this week, week starts on start_day (default is Monday)
+ # Returns number of days to start of this week, week starts on start_day (default is :monday).
def days_to_week_start(start_day = :monday)
start_day_number = DAYS_INTO_WEEK[start_day]
current_day_number = wday != 0 ? wday - 1 : 6
@@ -169,7 +169,7 @@ class Time
days_span >= 0 ? days_span : 7 + days_span
end
- # Returns a new Time representing the "start" of this week, week starts on start_day (deafult is Monday, e.g. Monday, 0:00)
+ # Returns a new Time representing the "start" of this week, week starts on start_day (default is :monday, i.e. Monday, 0:00).
def beginning_of_week(start_day = :monday)
days_to_start = days_to_week_start(start_day)
(self - days_to_start.days).midnight
@@ -177,7 +177,7 @@ class Time
alias :monday :beginning_of_week
alias :at_beginning_of_week :beginning_of_week
- # Returns a new Time representing the end of this week, week starts on start_day (deafult is Monday, end of Sunday)
+ # Returns a new Time representing the end of this week, week starts on start_day (default is :monday, i.e. end of Sunday).
def end_of_week(start_day = :monday)
days_to_end = 6 - days_to_week_start(start_day)
(self + days_to_end.days).end_of_day