arran4 / golang-ical

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

Proposal to add VEvent.GetDtStampTime #79

Closed galenwarren closed 10 months ago

galenwarren commented 10 months ago

Add VEvent.GetDtStampTime as a partner to VEvent.SetDtStampTime. It is currently possible to read out the value using GetProperty, but the getTimeProp helper function -- that is used to parse different time formats for other get methods -- is not exported.

PR: https://github.com/arran4/golang-ical/pull/80

arran4 commented 10 months ago

Hi @galenwarren Thanks. Merged. Do you need anything else as part of this?

galenwarren commented 10 months ago

@arran4 Thanks for the quick response!

I don't need anything else at the moment, but I am still working on the calendar support in my project. I suppose if I wind up needing to read another datetime field that doesn't already have a getter, a similar situation could arise.

What would you think about exporting the getTimeProp function? That would provide a workaround to read any datetime field. Just a thought. I'd be happy to push another commit for that if you want.

And thanks for the library! It's very useful.

arran4 commented 10 months ago

It seems it was originally public in ec4609c660b5fb81bef63e7b35e21000ea743afa but same committer made it private in d157595f14d4d8f598da18234436d099afaa13ec . I don't mind exposing it if it aids people. I don't see this function changing in the future, however I do like people contributing new functions, it makes the util more useful, it helps their stats, and means we have functions which are actually used.

If you think it's worth while exposing I will likely accept.

No worries hopefully it helps with what you're setting out to achieve.

galenwarren commented 10 months ago

That makes sense -- let's just leave it as-is for now and if something else comes up, I'll create another PR. Thanks!

arran4 commented 10 months ago

Occurs to me I forgot to tag this to release it.

arran4 commented 10 months ago
% git-tag-inc minor && git push --tags 
Largest: v0.1.0 (acf49e91370c784ffbf957f78ff68d50140b5542)
Creating v0.2.0