Fix iso8601 parsing in Safari #159

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@Manduro

Manduro commented Jan 9, 2014

Previous parsing result:
2014/01/09 01:06:21 UTC +0100

New parsing result:
2014/01/09 01:06:21 UTC+0100

Only in Safari, new Date("2014/01/09 01:06:21 UTC +0100") results in a "Invalid Date". Safari might even be right about not accepting this format.

When removing the space between UTC and the timezone designation, Safari parses the date correctly, as do other browsers.

A test page can be found here: http://jsfiddle.net/4aYGm/7/

Fix iso8601 parsing in Safari
Previous parsing result:
2014/01/09 01:06:21 UTC +0100

New parsing result:
2014/01/09 01:06:21 UTC+0100

Only in Safari, new Date("2014/01/09 01:06:21 UTC +0100") results in a "Invalid Date". Safari might even be right about not accepting this format.

When removing the space between UTC and the timezone designation, Safari parses the date correctly, as do other browsers.
@rmm5t

This comment has been minimized.

Show comment Hide comment
@rmm5t

rmm5t Jan 9, 2014

Owner

Hmm. I'm confused by this. Can you please explain why the current Timeago test suite passes 100% on Safari? Maybe we're missing an important test, but I will need to see a failing test before I'm willing to pull this change in.

http://timeago.yarp.com/test/

_jquery-timeago_test_suite

Owner

rmm5t commented Jan 9, 2014

Hmm. I'm confused by this. Can you please explain why the current Timeago test suite passes 100% on Safari? Maybe we're missing an important test, but I will need to see a failing test before I'm willing to pull this change in.

http://timeago.yarp.com/test/

_jquery-timeago_test_suite

@Manduro

This comment has been minimized.

Show comment Hide comment
@Manduro

Manduro Jan 10, 2014

I've dug a little deeper and it turns out the website where I had trouble is using incorrect ISO8601 timestamps.

2013-12-18T14:53:41Z+0100 instead of the correct 2013-12-18T14:53:41+0100

When using the correct format, everything works fine. So I was a little too fast to blame it on timeago, sorry :).

Manduro commented Jan 10, 2014

I've dug a little deeper and it turns out the website where I had trouble is using incorrect ISO8601 timestamps.

2013-12-18T14:53:41Z+0100 instead of the correct 2013-12-18T14:53:41+0100

When using the correct format, everything works fine. So I was a little too fast to blame it on timeago, sorry :).

@Manduro Manduro closed this Jan 10, 2014

@rmm5t

This comment has been minimized.

Show comment Hide comment
@rmm5t

rmm5t Jan 10, 2014

Owner

@Manduro Thanks for following-through, adding info, and closing this out.

Owner

rmm5t commented Jan 10, 2014

@Manduro Thanks for following-through, adding info, and closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment