arran4 / golang-ical

A ICS / ICal parser and serialiser for Golang.
Apache License 2.0
297 stars 73 forks source link

Better time parsing #43

Closed shaohme closed 2 years ago

shaohme commented 2 years ago

I would like to contribute a patch that expands the existing time.Time parsing in the library used for functions like GetStartAt, and GetAllDayStartAt, etc. At the moment these functions does not support timestamps and date strings like,

19980118T230000 <- error: cannot parse "" as "Z"
20210527Z <- error: cannot parse "Z" as "T"
20210628 <- error: cannot parse "" as "T"
20220122T170000Z <- error: extra text: "T170000Z" (when invoking GetAllDay.*At )

... and probably many others.

Would you reject a PR for such a feature?

arran4 commented 2 years ago

I don't think so. Provided it's compliant with the RFC, well written, has tests and won't break existing code.

shaohme commented 2 years ago

How about this #44 ?

arran4 commented 2 years ago

Sorry for the delay. I have some questions about it. I merged another PR that kind of conflicts.

shaohme commented 2 years ago

It's okay. I'll look into it now.

arran4 commented 2 years ago

Thanks.

shaohme commented 2 years ago

Thanks.

It should be mergeable now