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

Add WpDateTime to parse UTC/GMT time #454

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open

Conversation

crazytonyli
Copy link
Contributor

Relate to #262.

The new WpDateTime type is used on posts. If the solution looks good, I can make further changes to use it on other endpoints.

They don't get Sendable conformance by default now, because `WpDateTime`
uses a reference type internally.
// This is an intermediate struct to allow the public `WpDateTime` to be exported as a
// uniffi Record type. This struct itself is exported as a uniffi Object type.
#[derive(Debug, Clone, PartialEq, Eq, uniffi::Object)]
struct GMTDateTime {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need both WpDateTime & GMTDateTime at the same time since one is just a wrapper for the other. We can use one exported uniffi::Object with an inner type and that should be enough.

Copy link
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had already worked on a similar solution in another branch. I think that solution might be slightly more flexible to cover multiple date formats, but curious to hear what you think.

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

Successfully merging this pull request may close these issues.

2 participants