Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update README and bump version to 1.1.0

  • Loading branch information...
commit 58ba3301dcef3b10451796e86f84576b98357c79 1 parent a046f55
@jeremyevans authored
Showing with 19 additions and 17 deletions.
  1. +5 −1 CHANGELOG
  2. +13 −15 README.rdoc
  3. +1 −1  american_date.gemspec
View
6 CHANGELOG
@@ -1,4 +1,8 @@
-=== HEAD
+=== 1.1.0 (2013-03-23)
+
+* Handle MM/DD/YYYY substrings in the middle of strings, not just the beginning (sd, clonezone, jeremyevans) (#5)
+
+=== 1.0.1 (2013-03-20)
* Don't freeze the regular expression used, to allow easier overrides (jeremyevans)
View
28 README.rdoc
@@ -1,9 +1,9 @@
= ruby-american_date
-ruby-american_date exists to make ruby versions greater than 1.8
-parse american-style month/day/year dates correctly, just like
-ruby 1.8. It can also be used on ruby 1.8, but it is basically a
-noop there.
+ruby-american_date exists to make ruby 1.9+ parse american-style
+month/day/year dates correctly, with behavior matching ruby 1.8.7.
+It can also be used on earlier ruby version, but it is basically
+a noop there.
As far as I know, there isn't a gem that already handles this. You
can find many snippets on the web that partially solve the issue, but
@@ -12,19 +12,17 @@ DateTime.parse no longer call Date._parse directly on 1.9.3. Also
most don't handle cases where an american date format is used in
addition to a time format.
+Note that this gem only handles / separated dates. It does not
+handle - or . separated dates. This is by design.
+
== Design
-The general idea is fairly simple. We just check the beginning of
-the input string for an american date format, and transform it into
-a year-month-day ISO format before passing it to the standard date
-parsing methods. This is probably the least invasive way that works
-correctly on both the pure-ruby date parser (<1.9.3) and the C
-extension date parser (>=1.9.3).
-
-To reduce the possibility of problems, only the beginning of the
-input string is checked. So if you have an american date format
-embedded in the middle of the input string, it won't be translated.
-That may change in the future if it is determined to be safe.
+The general idea is fairly simple. We look for a month/day/year
+substring in the input string, and if we find it, we transform it
+into a year-month-day ISO format string before passing it to the
+standard date parsing methods. This is probably the least invasive
+way that works correctly on both the pure-ruby date parser (<1.9.3)
+and the C extension date parser (>=1.9.3).
== Tested ruby versions
View
2  american_date.gemspec
@@ -1,6 +1,6 @@
AMERICAN_DATE_GEMSPEC = Gem::Specification.new do |s|
s.name = 'american_date'
- s.version = '1.0.1'
+ s.version = '1.1.0'
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "MIT-LICENSE"]
Please sign in to comment.
Something went wrong with that request. Please try again.