ruby/ruby — pull request #454 by yaauie (2013-11-21 08:00:56+00:00)
Title: Fix bug where week-type arguments are parsed-and-ignored in Time::strptime

The underlying `Date::_strptime` returns a hash with week elements that are
ignored in the arguments passed to `Time::make_time`:

``` ruby
Date._strptime('2013-W46-4', '%Y-W%W-%w')
# => {:year=>2013, :wnum1=>46, :wday=>4}
Date.strptime('2013-W46-4', '%Y-W%W-%w')
# => #
```

This patch ensures that if these arguments are present, the resulting month
and day resolved from Date::strptime are not lost.

Before Patch (WRONG):
``` ruby
Time.strptime('2013-W46-4', '%Y-W%W-%w')
# => 2013-01-01 00:00:00 UTC
```

After Patch (CORRECT):
``` ruby
Time.strptime('2013-W46-4', '%Y-W%W-%w')
# => 2013-11-21 00:00:00 UTC
```

I am unsure of where to add tests for this, but believe that the fix should be back-ported to the 1.9 branch.