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 #816

Closed
lukewestby opened this Issue Jan 20, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@lukewestby
Member

lukewestby commented Jan 20, 2017

There seem to be a few issues popping up around Dates including some duplicates of previously closed issues, so lets track them here

  • #632 - Browser inconsistencies in parsing with new Date()
  • #690 - Sufficiently large numbers crash Date.fromTime
  • #755, #739 - Getting timezone offset for Dates
  • #481, #810 - toString date results in a string that is not consistently parseable as a Date
  • #857 - Construct a Date from year, month, day
  • #855 - Date.fromString interacts with browser env
  • #851 - Date type is not comparable

Some summarizing of things that Dates need to resolve issues:

  • Consistent, crash-free parsing of inputs (ISO strings and Times)
  • Support for UTC offset
  • Consistent, possibly standard-compliant output from toString
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jul 6, 2017

Member

I changed Date.fromString to Date.fromIso8601 which verifies the format and cannot crash.

I also added Date.toIso8601 which always produces a String in the same format.

I believe the issue with browsers adding in time zone information can be resolved if these two functions are moved into Time which does not care about time zones. Then perhaps Date should move out of core, either to elm-lang/date or a community package, until we can do something like this.

Member

evancz commented Jul 6, 2017

I changed Date.fromString to Date.fromIso8601 which verifies the format and cannot crash.

I also added Date.toIso8601 which always produces a String in the same format.

I believe the issue with browsers adding in time zone information can be resolved if these two functions are moved into Time which does not care about time zones. Then perhaps Date should move out of core, either to elm-lang/date or a community package, until we can do something like this.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 22, 2018

Member

I think the problems with JS Date are unsolvable, so I made https://github.com/elm-lang/time to do things in a reasonable way. Should not have any of these problems anymore.

Member

evancz commented May 22, 2018

I think the problems with JS Date are unsolvable, so I made https://github.com/elm-lang/time to do things in a reasonable way. Should not have any of these problems anymore.

@evancz evancz closed this May 22, 2018

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