adzap / timeliness

Fast date/time parsing for the control freak.
http://github.com/adzap/timeliness
MIT License
224 stars 27 forks source link

Fix parsing error when invalid datetime string with timezone #29

Closed lnit closed 5 years ago

lnit commented 5 years ago

Hello,

I get NoMethodError when input invalid time string with timezone. (See: https://github.com/adzap/validates_timeliness/issues/182)

Loading development environment (Rails 5.2.2)
2.5.3 :001 > Timeliness::Parser.parse("2019-01-30T25:12:14+09:00")
Traceback (most recent call last):
        1: from (irb):1
NoMethodError (undefined method `utc_offset' for nil:NilClass)

I attempted fix this issue. Can you review code changes?

Thanks.

lnit commented 5 years ago

@adzap Can you review code, please...? 😢

adzap commented 5 years ago

Thanks for this!

lnit commented 5 years ago

Thank you! 😄