fix: Improve date parsing (fractional seconds, UTC offsets)#2803
fix: Improve date parsing (fractional seconds, UTC offsets)#2803CountBleck merged 10 commits intoAssemblyScript:mainfrom
Conversation
|
Hmmm.. the I'll revert that change and see if the rest passes in CI. |
This reverts commit c456422.
|
That seems to have been the issue. At least, reverting the fixture for |
|
@mattjohnsonpint Yes.please ignore std math test in aarch64. It also bother me a lot. I guess there are maybe some bugs in nodes |
CountBleck
left a comment
There was a problem hiding this comment.
LGTM, since the other tests are working as intended.
Co-authored-by: CountBleck <Mr.YouKnowWhoIAm@protonmail.com>
|
Applied all feedback, and rebuilt the |
|
OK, I'm stumped. Why do I get A fixture mismatch error in CI? I used a Windows x64 machine to generate the last ones, and it still fails. Everything passes locally though. 😕 |
|
Thanks everyone! Please merge when ready. 🙂 |
|
Looks like everyone's onboard, so I'm merging this. |
The logic used by
Date.fromStringandDate.parsehas a few issues:"2000-01-01T00:00:00.123456789Z"was being treated as having 123456789 milliseconds, making the result wildly too large. Such values should be truncated to 3 decimal places before being interpreted as milliseconds."2000-01-01T00:00:00.1"was treated as having 1 millisecond, though it should be one tenth of a second (or 100 milliseconds).+05:30or-08:00), which is required by ISO 8601, RFC 3339, and the ECMAScript standard date format.This PR addresses all three issues, and updates the existing
Date#fromStringtest.I also made two small unrelated changes:
I32.parseIntwithi32.parseinstd/assembly/date.tsto resolve deprecation warningsRegenerated the fixture for. (reverted this due to CI test failure. See comments below.)std/mathtest to resolve "fixture mismatch" error that was occurring on a clean clone of the repo before I made any changes. (Not sure what update caused that, but compiler tests were failing.)Thanks.