]> git.kaiwu.me - quickjs.git/commit
Improve Date.parse
authorCharlie Gordon <github@chqrlie.org>
Sun, 25 Feb 2024 22:47:26 +0000 (23:47 +0100)
committerCharlie Gordon <github@chqrlie.org>
Sun, 25 Feb 2024 22:47:26 +0000 (23:47 +0100)
commit78db49cf9543b983d5f0edf361cbfe907451c826
tree291161f1a324d8545932e41d46b671ed4ba12360
parent6428ce0c8b6f691dbd26c7fe7f11396fdd364d25
Improve Date.parse

- rewrite Date.parse() with separate parsers
- return `NaN` for out of bounds field values as specified
- accept up to 9 decimals for millisecond fraction but truncate at 3
- accept many more alternative date/time formats
- add test cases in tests/test_builtin.js
quickjs.c
tests/test_builtin.js