Cumulus / Syndic

RSS and Atom feed parsing
MIT License
34 stars 13 forks source link

date parsing: "Thu, 17 Dec 2015 02:14:42 EST" doesn't parse but apparently it should #63

Closed pwbs closed 8 years ago

pwbs commented 8 years ago
utop # Syndic_date.of_rfc822 "Thu, 17 Dec 2015 02:14:42 CEST";;
Exception:
Invalid_argument "Syndic.Date.of_string: cannot parse \"Thu, 17 Dec 2015 02:14:42 CEST\"".
utop # Syndic_date.of_rfc822 "Thu, 17 Dec 2015 02:14:42 +0500";;
- : Syndic_date.t = <abstr>

according to http://www.w3.org/Protocols/rfc822/ section 5.1, it's Syndic_date.of_rfc822 that's in the wrong.

pwbs commented 8 years ago

I'll probably suggest a patch...

pwbs commented 8 years ago

Reading https://github.com/Cumulus/Syndic/blob/master/lib/syndic_date.ml#L55-L67 I wonder if my bug report matches the semantics of the current version of Syndic (I suspect not). However, it doesn't affect the fact that those American timezones are not handled correctly since it's done in https://github.com/Cumulus/Syndic/blob/master/lib/syndic_date.ml#L38-L47.

pwbs commented 8 years ago

https://github.com/Cumulus/Syndic/pull/64 should fix this.