Skip to content

Commit

Permalink
Add documentation for the TimeWithZone#dst? method.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
MattStopa committed Jan 1, 2013
1 parent 3511e3f commit 6d5385a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions activesupport/lib/active_support/time_with_zone.rb
Expand Up @@ -80,6 +80,12 @@ def localtime
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
Expand Down

0 comments on commit 6d5385a

Please sign in to comment.