Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Issue in parsing ISO string #119

Open
zubair1103 opened this issue Apr 13, 2018 · 3 comments
Open

Issue in parsing ISO string #119

zubair1103 opened this issue Apr 13, 2018 · 3 comments

Comments

@zubair1103
Copy link

zubair1103 commented Apr 13, 2018

ISO string could not be parsed.

Following statement returns null.

Date.parse("2018-04-13T12:26:47.78Z")

@zubair1103 zubair1103 changed the title Issue in parsing IOS string Issue in parsing ISO string Apr 13, 2018
@MareoRaft
Copy link

Similarly, an ISO string representation of a datetime Python object cannot be parsed:

Date.parse('2018-07-03T14:15:16.002222')

It seems that datejs can't handle the millisecond decimal at the end.

@joaoeffting
Copy link

Same here ... any work around for you guys?

@MareoRaft
Copy link

Well I might suggest something like

  1. Write a function to detect the presence of milliseconds
  2. splitting it into the pieces '2018-07-03T14:15:16' and '002222'
  3. Using Date.parse on the left piece
  4. Adjusting the Date object by adding the milliseconds to it
  5. Make a PR to this repo which encorporates your fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants