Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

IntlPolyfill.__localeSensitiveProtos.Date.toLocaleString doesn't work as specified #192

Closed
headcr4sh opened this issue Jun 27, 2016 · 2 comments

Comments

@headcr4sh
Copy link
Contributor

I have just tried v1.2.4 (latest) of the Intl polyfill.

According to #117 this issue should have been fixed by PR #146 .
Unfortunately, my latest tests indicate, that the opposite is still the case...

(function () {
  var date = new Date(2016, 0, 1); // January, 1st 2016
  var locale = "en-us"; // Other locales won't work as well, btw.
  var format = { month: "long" }; // Valid date format according to the Intl spec.
  // Use the IntlPolyfill version of Date.toLocaleString even if the environment won't
  // actually need the polyfill 
  var str = IntlPolyfill.__localeSensitiveProtos.Date.toLocaleString.bind(date)(locale, format);
  if (str !== "January") {
    throw new Error("Intl polyfill is still defunct. Expected: 'January', got: '" +  str + "'!");
  }
})();

The result when executing the code abote is Jan. And that is clearly not the expected result when using the formatter { month: "long" }.

I can confirm that the code above yields the correct result, when using v1.1.0 of the Intl polyfill.
So I assume a regression bug.

@caridy
Copy link
Collaborator

caridy commented Jul 1, 2016

dupe of #190

@caridy caridy closed this as completed Jul 1, 2016
@headcr4sh
Copy link
Contributor Author

@caridy Sorrt... didn't see the duplicate. My bad...

caridy added a commit that referenced this issue Jul 5, 2016
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

2 participants