-
Notifications
You must be signed in to change notification settings - Fork 17
Add support for RFC2822 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Useful. Sort of. I just implemented the exact same thing and was about to submit a pull request. Serves me right for not checking existing ones. Anyhoo, could this be merged? It's quite useful - in my case for parsing dates in RSS feeds. |
|
@rypervenche your implementation breaks when DateTime::Timezones is in use. [1 zerodogg@mal ~]+$ raku -MDateTime::Parse -e 'say DateTime::Parse.new("Tue, 08 Sep 2020 14:11:48 +0230")'
2020-09-08T14:11:48Z
[0 zerodogg@mal ~]+$ raku -MDateTime::Timezones -MDateTime::Parse -e 'say DateTime::Parse.new("Tue, 08 Sep 2020 14:11:48 +0230")'
This type cannot unbox to a native integer: P6opaque, Str
in method <anon> at /var/home/zerodogg/.raku/sources/3B675F5F3A9B8F11C18AE4B193F9F53345002C31 (DateTime::Timezones) line 120
in method rfc2822-date at /var/home/zerodogg/.raku/sources/703635D3023B1FE6D98BF2600452B9BCA55789BB (DateTime::Parse) line 173
in regex rfc2822-date at /var/home/zerodogg/.raku/sources/703635D3023B1FE6D98BF2600452B9BCA55789BB (DateTime::Parse) line 70
in regex TOP at /var/home/zerodogg/.raku/sources/703635D3023B1FE6D98BF2600452B9BCA55789BB (DateTime::Parse) line 8
in method new at /var/home/zerodogg/.raku/sources/703635D3023B1FE6D98BF2600452B9BCA55789BB (DateTime::Parse) line 307
in block <unit> at -e line 1Using non-RFC2822 works, however: [0 zerodogg@mal ~]+$ raku -MDateTime::Timezones -MDateTime::Parse -e 'say DateTime::Parse.new("Tue, 08 Sep 2020 14:11:48 GMT")'
2020-09-08T14:11:48Z |
|
@alabamenhu do you have any idea what is going on here -^ ? |
This should be resolved now with |
|
@alabamenhu That fixed it, cheers! |
|
I've just merged some old PRs and I wanted to merge this, but there are conflicts, could you please take a look @rypervenche ? |
|
Or if you @zerodogg or @alabamenhu want to create a new PR for that, I'll be forever grateful :) |
Adding support for RFC2822 as per https://tools.ietf.org/html/rfc2822#section-3.3.