aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_support_core_extensions.md
diff options
context:
space:
mode:
authorGagan Awhad <gagan.awhad@desiringgod.org>2013-02-22 10:10:42 -0600
committerGagan Awhad <gagan.awhad@desiringgod.org>2013-02-22 10:10:42 -0600
commitf7a0a95de2daa4f8e68e0b1687f1d77df70d7778 (patch)
treeba409e3ad0b4e0dd4fab3e4c8f3d43d21946d312 /guides/source/active_support_core_extensions.md
parent7ded3b8c4bb24e02a93ced0dc78879c3210b526c (diff)
downloadrails-f7a0a95de2daa4f8e68e0b1687f1d77df70d7778.tar.gz
rails-f7a0a95de2daa4f8e68e0b1687f1d77df70d7778.tar.bz2
rails-f7a0a95de2daa4f8e68e0b1687f1d77df70d7778.zip
Added documentation for beginning_of_minute and end_of_minute to Active Support Core Extensions guide
Diffstat (limited to 'guides/source/active_support_core_extensions.md')
-rw-r--r--guides/source/active_support_core_extensions.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index f02b377832..517db0d222 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -3320,7 +3320,25 @@ date.end_of_hour # => Mon Jun 07 19:59:59 +0200 2010
`beginning_of_hour` is aliased to `at_beginning_of_hour`.
-INFO: `beginning_of_hour` and `end_of_hour` are implemented for `Time` and `DateTime` but **not** `Date` as it does not make sense to request the beginning or end of an hour on a `Date` instance.
+##### `beginning_of_minute`, `end_of_minute`
+
+The method `beginning_of_minute` returns a timestamp at the beginning of the minute (hh:mm:00):
+
+```ruby
+date = DateTime.new(2010, 6, 7, 19, 55, 25)
+date.beginning_of_minute # => Mon Jun 07 19:55:00 +0200 2010
+```
+
+The method `end_of_minute` returns a timestamp at the end of the minute (hh:mm:59):
+
+```ruby
+date = DateTime.new(2010, 6, 7, 19, 55, 25)
+date.end_of_minute # => Mon Jun 07 19:55:59 +0200 2010
+```
+
+`beginning_of_minute` is aliased to `at_beginning_of_minute`.
+
+INFO: `beginning_of_hour`, `end_of_hour`, `beginning_of_minute` and `end_of_minute` are implemented for `Time` and `DateTime` but **not** `Date` as it does not make sense to request the beginning or end of an hour or minute on a `Date` instance.
##### `ago`, `since`