arran4 / golang-ical

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

Fix for all day events (#55) #61

Closed cuvar closed 10 months ago

cuvar commented 1 year ago

Hopefully, this implementation should fix #55. At least, this solutions seems to have worked for me. I took @kevinmorio's approach mentioned in the issue here.

arran4 commented 1 year ago

@cuvar Thanks. I will get back to you in a couple days. I will have to check the RFC(s) for what it says it should be too.

However;

    icalDateFormatLocal      = "20060102"
    icalDateFormat               = "20060102"

They are the same value.

cuvar commented 1 year ago

cool, thanks! I'll add another commit regarding the icalDateFormatLocal and icalDateFormat

arran4 commented 1 year ago

Thanks. @cuvar What I'm thinking is that this changes behaviour, so how about we just duplicate the functions and append Local (Edit; actually it should really be UTC as it's not in the local timezone, we would have to replace the UTC() and ask for the timezone they want to use; and if we do that it should be appended with InLocation instead of Local or UTC) to them so we don't impact existing users. We also haven't considered deserialization here but I believe the function is more flexible.

Another approach would be to make it do a better job at detecting the format of the date/time being used.

cuvar commented 1 year ago

I'm sorry, but unfortunately I won't have the time to dive into the code in the next time. Therefore, I just created this shallow fix. If there's more time, I'll have a look into it again.

arran4 commented 1 year ago

@cuvar Thanks though. Perhaps someone else will come and pick up this PR. Did you get your problem solved at all? If not I can figure something out. What timezone are you?

cuvar commented 1 year ago

Thanks! Yes, it seems to have solved my issue. My timezone is UTC+1

arran4 commented 10 months ago

I will still look into this when I get some time to work on this project.