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

JulianDate.toIso8601 builds a non compliant string with very small milliseconds #11507

Open
jfayot opened this issue Sep 6, 2023 · 1 comment
Labels
category - architecture / api good first issue An opportunity for first time contributors type - bug

Comments

@jfayot
Copy link

jfayot commented Sep 6, 2023

console.log(Cesium.JulianDate.toIso8601(Cesium.JulianDate.fromIso8601("2011-03-25T16:00:00.00000001Z"))

outputs:

2011-03-25T16:00:00.10000803740695119e-7Z

Which is not ISO8601 compliant !

In JulianDate.js, line 787, the comment says:

//Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.

but toString will automatically convert the milliseconds into scientific notation when lower than 1e-6.
number.toFixed is not appropriate neither, something more sophisticated needed here...

@jfayot jfayot changed the title JulianDate.toIso8601 builds a non compliant string with very small millseconds Sep 6, 2023
@ggetz ggetz added type - bug category - architecture / api good first issue An opportunity for first time contributors labels Sep 6, 2023
@ggetz
Copy link
Contributor

ggetz commented Sep 6, 2023

Thanks for the report @jfayot!

We'd be happy to review a fix if you or anyone else has the bandwidth to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category - architecture / api good first issue An opportunity for first time contributors type - bug
2 participants