aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:17:24 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-27 11:17:24 +0000
commit05a4db5ecabeca9e04a48baffc7b0ef2febc3d70 (patch)
tree41d37de9d121b65efd76645b47422b2cb5a75fef /activesupport/lib/active_support/core_ext/string
parentd760d882d77bbc0f780a76a9a78415a469bc4278 (diff)
downloadrails-05a4db5ecabeca9e04a48baffc7b0ef2febc3d70.tar.gz
rails-05a4db5ecabeca9e04a48baffc7b0ef2febc3d70.tar.bz2
rails-05a4db5ecabeca9e04a48baffc7b0ef2febc3d70.zip
Ruby 1.9 compat: don't use obsolete ParseDate
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8490 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string')
-rw-r--r--activesupport/lib/active_support/core_ext/string/conversions.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb
index 663ea8747b..d4334dcefe 100644
--- a/activesupport/lib/active_support/core_ext/string/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -1,4 +1,4 @@
-require 'parsedate'
+require 'date'
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
@@ -12,15 +12,15 @@ module ActiveSupport #:nodoc:
# Form can be either :utc (default) or :local.
def to_time(form = :utc)
- ::Time.send("#{form}_time", *ParseDate.parsedate(self)[0..5].map {|arg| arg || 0})
+ ::Time.send("#{form}_time", *::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
end
def to_date
- ::Date.new(*ParseDate.parsedate(self)[0..2])
+ ::Date.new(*::Date._parse(self, false).values_at(:year, :mon, :mday))
end
def to_datetime
- ::DateTime.civil(*ParseDate.parsedate(self)[0..5].map {|arg| arg || 0} << 0)
+ ::DateTime.civil(*::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
end
end
end