jeremyevans / home_run

Fast Date/DateTime classes for ruby :: Unmaintained, unnecessary on ruby 1.9.3+
Other
465 stars 10 forks source link

DateTime.civil has problems with string timezones #37

Closed cgriego closed 13 years ago

cgriego commented 13 years ago

I think I finally have a legitimate home_run behavior bug. :) Passing strings to DateTime.civil for the zone is handled in std lib and not in home_run.

[ree-1.8.7] $ ruby -rdate -e 'puts DateTime.civil(2010, 11, 14, 22, 0, 0, "Z")'
2010-11-14T22:00:00+00:00
[ree-1.8.7] $ home_run ruby -rdate -e 'puts DateTime.civil(2010, 11, 14, 22, 0, 0, "Z")'
-e:1:in `civil': no implicit conversion to float from string (TypeError)
    from -e:1

[ree-1.8.7] $ ruby -rdate -e 'puts DateTime.civil(2010, 11, 14, 22, 0, 0, "+1000")'
2010-11-14T22:00:00+10:00
[ree-1.8.7] $ home_run ruby -rdate -e 'puts DateTime.civil(2010, 11, 14, 22, 0, 0, "+1000")'
-e:1:in `civil': no implicit conversion to float from string (TypeError)
    from -e:1
jeremyevans commented 13 years ago

home_run certainly should be handling that if the stdlib supports it. Shouldn't be a hard fix.

jeremyevans commented 13 years ago

I'll try to put out a new release with this fix tomorrow after I build new windows binary gems and give it wider testing. Might wait till next week if I get busy.

cgriego commented 13 years ago

Thanks for the quick turnaround!