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

ISO-8601 compliant datetime strings #457

Open
lucasgarfield opened this issue Oct 5, 2022 · 0 comments
Open

ISO-8601 compliant datetime strings #457

lucasgarfield opened this issue Oct 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@lucasgarfield
Copy link
Contributor

https://en.wikipedia.org/wiki/ISO_8601

Currently the API returns a human readable string for the time a compose was created, something like "2022-10-01 08:31:13.23555 +0000 UTC".

Is there any issue with returning an ISO-8601 compliant string instead? The example given would in that case be: "2022-10-01T08:31:13.23555+00:00". This is slightly less human readable, but would be much easier to parse if working with the API programmatically.

For instance, I am currently implementing a feature in the front end that requires me to find the most recently created image. Javascript's Date() object is able to parse ISO-8601 compliant datetime strings and I would be able to simply write code like this:

const date1 = new Date('2022-10-01T08:31:13.23555+00:00"');
const date2 = new Date('2022-10-01T08:32:13.23555+00:00"');
if (date1 > date2) {
  ...
}

(Note that Javascript's Date() object is not able to parse what the API currently returns.)

@lucasgarfield lucasgarfield added the enhancement New feature or request label Oct 5, 2022
kingsleyzissou added a commit to kingsleyzissou/image-builder that referenced this issue Oct 28, 2022
Return an ISO8601 compliant datetime to facilitate
easier parsing and comparison in the frontend.

Addresses osbuild#457
kingsleyzissou added a commit to kingsleyzissou/image-builder that referenced this issue Oct 28, 2022
Return an ISO8601 compliant datetime to facilitate
easier parsing and comparison in the frontend.

Addresses osbuild#457
croissanne pushed a commit that referenced this issue Oct 31, 2022
Return an ISO8601 compliant datetime to facilitate
easier parsing and comparison in the frontend.

Addresses #457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant