[quickjs-devel] Re: Bug report: incorrect handling of fractions of seconds in dates parse

  • From: Charlie Gordon <quickjs@xxxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Tue, 6 Aug 2019 08:46:17 +0200

Hi Alexander,

Good find! all date fields were parsed as integers, which is only inappropriate 
for the fractional second part.
I fixed it, the patch will be included in the next release.

Thanks for your feedback.

Chqrlie.

On 5 Aug 2019, at 23:24, Alexander Rodin <rodin.alexander@xxxxxxxxx> wrote:

In quickjs-2019-07-28 fractions of the seconds in ISO dates are not parsed 
correctly when number of digits after the point is not equal to three:

qjs > new Date("2020-01-01T01:01:01.1Z").toISOString()
"2020-01-01T01:01:01.001Z”

qjs > new Date("2020-01-01T01:01:01.12Z").toISOString()
"2020-01-01T01:01:01.012Z”

qjs > new Date("2020-01-01T01:01:01.123Z").toISOString()
"2020-01-01T01:01:01.123Z”

qjs > new Date("2020-01-01T01:01:01.1234Z").toISOString()
"2020-01-01T01:01:02.234Z”

qjs > new Date("2020-01-01T01:01:01.12345Z").toISOString()
"2020-01-01T01:01:13.345Z”

Thanks,
Alexander


Other related posts: