Skip to content
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

How to access the time of a waypoint? #79

Closed
gerritsangel opened this issue Jul 23, 2022 · 10 comments
Closed

How to access the time of a waypoint? #79

gerritsangel opened this issue Jul 23, 2022 · 10 comments

Comments

@gerritsangel
Copy link

Hello,

Thanks a lot for the crate! This makes handling of gpx files really easy.

I have one question though: How can I, as a consumer, properly work with the time of a waypoint? Maybe I'm missing it, but although with the newest commit, the Time struct is exported, I can only format it directly to a string. I would like to have it as a chrono DateTime to further do some calculations on it.

Currently it seems that I have to format it as a String (involving an allocation), just to have it again parsed again by chrono.

What about a chrono feature of the crate, which could transform the Time as a chrono DateTime?

@major-seven
Copy link

major-seven commented Jul 25, 2022

I just wanted to come here and ask exactly the same thing. :)
I think a quick workaround would be to just use OffsetDateTime::parse(time_string.as_str(), &Rfc3339) since it seems to be only possible to extract the time as a string. However it would be more efficient to directly use the already existing OffsetDateTime and omit the second string parsing. Is there a reason that the OffsetDateTime field in the gpx Time struct is private and not public?

@lnicola
Copy link
Member

lnicola commented Jul 25, 2022

See #76.

@michaelkirk
Copy link
Member

So it looks like the feature has been added and at this point we're just waiting on a release, is that right?

@lnicola - would you be interested in becoming a publisher for this crate?

@lnicola
Copy link
Member

lnicola commented Aug 2, 2022

So it looks like the feature has been added and at this point we're just waiting on a release, is that right?

I'm not sure that's the greatest API, but we're only on 0.8, so sure.

would you be interested in becoming a publisher for this crate?

Sure, I can do this if needed, but it's a bit weird to cut out new releases for a crate I've never used 😅.

@michaelkirk
Copy link
Member

would you be interested in becoming a publisher for this crate?

Added - publish at will!

@lnicola
Copy link
Member

lnicola commented Aug 12, 2022

I'll try to do this tomorrow.. where did the last 10 days go? 😢

@jscatena88
Copy link

Looks like this still hasn't been published. Any chance to make it happen?

@lnicola
Copy link
Member

lnicola commented May 30, 2023

Looking into it now, sorry. First part is #86.

@lnicola
Copy link
Member

lnicola commented May 30, 2023

gpx 0.9.0 is up on crates.io, I hope I didn't mess something up.

@lnicola lnicola closed this as completed May 30, 2023
@jscatena88
Copy link

@lnicola It worked perfect for my use case! Thanks a bunch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants