aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorTanmay Sinha <tanmay3011@gmail.com>2015-10-04 19:23:55 +0530
committerTanmay Sinha <tanmay3011@gmail.com>2015-10-04 19:23:55 +0530
commitb15e8dfd742a4d38d29e3286bdbfb2299d4ce92b (patch)
tree203e38188cf4319efd9ff6d0954f0b0b275d6057 /activesupport
parent67597e1719ec6af7e22964603cc77aa5b085a864 (diff)
downloadrails-b15e8dfd742a4d38d29e3286bdbfb2299d4ce92b.tar.gz
rails-b15e8dfd742a4d38d29e3286bdbfb2299d4ce92b.tar.bz2
rails-b15e8dfd742a4d38d29e3286bdbfb2299d4ce92b.zip
Use Time#current instead of Time#now to prevent zone issue inorder to use application's time zone
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index f13d09f3ad..645dcf98c4 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -18,7 +18,7 @@ class Time
# Return the number of days in the given month.
# If no year is specified, it will use the current year.
- def days_in_month(month, year = now.year)
+ def days_in_month(month, year = current.year)
if month == 2 && ::Date.gregorian_leap?(year)
29
else