aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2017-09-16 18:36:49 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2017-10-24 21:17:54 +0300
commitf2c1e3a793570584d9708aaee387214bc3543530 (patch)
tree71049e85a851592601961f7f0dd0e38f6ac62215 /activesupport/CHANGELOG.md
parent61ac2167eff741bffb44aec231f4ea13d004134e (diff)
downloadrails-f2c1e3a793570584d9708aaee387214bc3543530.tar.gz
rails-f2c1e3a793570584d9708aaee387214bc3543530.tar.bz2
rails-f2c1e3a793570584d9708aaee387214bc3543530.zip
Allows pass argument for `Time#prev_month` and `Time#next_month`
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 435c863025..14435649cd 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,30 @@
+* Add same method signature for `Time#prev_month` and `Time#next_month`
+ in accordance with `Date#prev_month`, `Date#next_month`.
+
+ Allows pass argument for `Time#prev_month` and `Time#next_month`.
+
+ Before:
+ ```
+ Time.new(2017, 9, 16, 17, 0).prev_month # => 2017-08-16 17:00:00 +0300
+ Time.new(2017, 9, 16, 17, 0).prev_month(1)
+ # => ArgumentError: wrong number of arguments (given 1, expected 0)
+
+ Time.new(2017, 9, 16, 17, 0).next_month # => 2017-10-16 17:00:00 +0300
+ Time.new(2017, 9, 16, 17, 0).next_month(1)
+ # => ArgumentError: wrong number of arguments (given 1, expected 0)
+ ```
+
+ After:
+ ```
+ Time.new(2017, 9, 16, 17, 0).prev_month # => 2017-08-16 17:00:00 +0300
+ Time.new(2017, 9, 16, 17, 0).prev_month(1) # => 2017-08-16 17:00:00 +0300
+
+ Time.new(2017, 9, 16, 17, 0).next_month # => 2017-10-16 17:00:00 +0300
+ Time.new(2017, 9, 16, 17, 0).next_month(1) # => 2017-10-16 17:00:00 +0300
+ ```
+
+ *bogdanvlviv*
+
* Add same method signature for `Time#prev_day` and `Time#next_day`
in accordance with `Date#prev_day`, `Date#next_day`.