New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date.parse doesn't work in certain browsers #939

Closed
loovjo opened this Issue Feb 1, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@loovjo

loovjo commented Feb 1, 2018

Date.parse does not work for certain dates in Firefox, but does in Opera and Chrome. For example, the following code produces a parse error in Firefox, but works in Chrome:

import Html exposing (text)
import Date

main = text <| toString <| Date.fromString "2018-02-24UTC"
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Feb 1, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Feb 1, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@perty

This comment has been minimized.

Show comment
Hide comment
@perty

perty Feb 17, 2018

I tried the code in the online Elm editor and as said in OP, it is different results in FF and Chrome:
FF: Err "Unable to parse '2018-02-24UTC' as a date. Dates must be in the ISO 8601 format."
Chrome: Ok <Sat Feb 24 2018 01:00:00 GMT+0100 (CET)>

According to the standard, FF is correct, the date in the example is not a correct date.

perty commented Feb 17, 2018

I tried the code in the online Elm editor and as said in OP, it is different results in FF and Chrome:
FF: Err "Unable to parse '2018-02-24UTC' as a date. Dates must be in the ISO 8601 format."
Chrome: Ok <Sat Feb 24 2018 01:00:00 GMT+0100 (CET)>

According to the standard, FF is correct, the date in the example is not a correct date.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Mar 7, 2018

Member

It is getting removed from core in the next release. It will be replaced by parsers written in Elm for various formats such that we have guaranteed reliability.

Member

evancz commented Mar 7, 2018

It is getting removed from core in the next release. It will be replaced by parsers written in Elm for various formats such that we have guaranteed reliability.

@evancz evancz closed this Mar 7, 2018

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