From b15e8dfd742a4d38d29e3286bdbfb2299d4ce92b Mon Sep 17 00:00:00 2001 From: Tanmay Sinha Date: Sun, 4 Oct 2015 19:23:55 +0530 Subject: Use Time#current instead of Time#now to prevent zone issue inorder to use application's time zone --- activesupport/lib/active_support/core_ext/time/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/time') 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 -- cgit v1.2.3