aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2012-01-18 20:57:24 +0300
committerVasiliy Ermolovich <younash@gmail.com>2012-01-18 20:57:24 +0300
commitf54b8468c739055164aa8f51e9680c43a51c4381 (patch)
tree6aec13922496428e455ec9a6c03751558e91e7ae
parente1540897101b710f4cf06cbe971ba04e59c4fb71 (diff)
downloadrails-f54b8468c739055164aa8f51e9680c43a51c4381.tar.gz
rails-f54b8468c739055164aa8f51e9680c43a51c4381.tar.bz2
rails-f54b8468c739055164aa8f51e9680c43a51c4381.zip
remove ruby 1.8 related code
-rw-r--r--activesupport/lib/active_support/core_ext/date_time/conversions.rb15
1 files changed, 0 insertions, 15 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb
index d7b3ad7d8d..e5f895478a 100644
--- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb
@@ -58,32 +58,17 @@ class DateTime
alias_method :default_inspect, :inspect
alias_method :inspect, :readable_inspect
- # Converts self to a Ruby Date object; time portion is discarded.
- def to_date
- ::Date.new(year, month, day)
- end unless instance_methods(false).include?(:to_date)
-
# Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class.
# If self has an offset other than 0, self will just be returned unaltered, since there's no clean way to map it to a Time.
def to_time
self.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec, sec_fraction * 1000000) : self
end
- # To be able to keep Times, Dates and DateTimes interchangeable on conversions.
- def to_datetime
- self
- end unless instance_methods(false).include?(:to_datetime)
-
def self.civil_from_format(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0)
offset = utc_or_local.to_sym == :local ? local_offset : 0
civil(year, month, day, hour, min, sec, offset)
end
- # Converts datetime to an appropriate format for use in XML.
- def xmlschema
- strftime("%Y-%m-%dT%H:%M:%S%Z")
- end unless instance_methods(false).include?(:xmlschema)
-
# Converts self to a floating-point number of seconds since the Unix epoch.
def to_f
seconds_since_unix_epoch.to_f