aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-01-23 02:11:00 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-01-23 02:11:00 +0000
commit2e7b2f03448e5759113ce0c182ed99897342c7a9 (patch)
treeec35655e12924d0075abc7a0e36aa1eea1e6e545 /activesupport/lib/active_support/values
parent022d9f7ce6d1237c4103a2aed561220e1c0f4dcc (diff)
downloadrails-2e7b2f03448e5759113ce0c182ed99897342c7a9.tar.gz
rails-2e7b2f03448e5759113ce0c182ed99897342c7a9.tar.bz2
rails-2e7b2f03448e5759113ce0c182ed99897342c7a9.zip
Adding alternate_utc_string option to TimeZone#formatted_offset. Removing unneeded TimeZone#offset
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 92d6febda3..689ba5a6e5 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -156,17 +156,9 @@ class TimeZone
end
# Returns the offset of this time zone as a formatted string, of the
- # format "+HH:MM". If the offset is zero, this returns the empty
- # string. If +colon+ is false, a colon will not be inserted into the
- # result.
- def formatted_offset(colon=true)
- utc_offset == 0 ? '' : offset(colon)
- end
-
- # Returns the offset of this time zone as a formatted string, of the
# format "+HH:MM".
- def offset(colon=true)
- utc_offset.to_utc_offset_s(colon)
+ def formatted_offset(colon=true, alternate_utc_string = nil)
+ utc_offset == 0 && alternate_utc_string || utc_offset.to_utc_offset_s(colon)
end
# Compare this time zone to the parameter. The two are comapred first on