From 6d5385a1354a8bec2ac522693c1173e547ffd61e Mon Sep 17 00:00:00 2001 From: Matthew Stopa Date: Mon, 31 Dec 2012 19:04:10 -0700 Subject: Add documentation for the TimeWithZone#dst? method. [ci skip] --- activesupport/lib/active_support/time_with_zone.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 0dbc198ea2..89f37114fd 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -80,6 +80,12 @@ module ActiveSupport end alias_method :getlocal, :localtime + # Returns true if the the current time is within Daylight Savings Time for the + # specified time zone. + # + # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' + # Time.zone.parse("2012-5-30").dst? # => true + # Time.zone.parse("2012-11-30").dst? # => false def dst? period.dst? end -- cgit v1.2.3