Skip to content
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

Change in behavior of Date.toLocaleDateString() in version 4.2.3 #4159

Closed
scottbrady opened this issue Dec 4, 2015 · 9 comments
Closed

Change in behavior of Date.toLocaleDateString() in version 4.2.3 #4159

scottbrady opened this issue Dec 4, 2015 · 9 comments
Labels
i18n-api Issues and PRs related to the i18n implementation.

Comments

@scottbrady
Copy link

I upgraded from version 4.2.2 to version 4.2.3 and noticed a change in the behavior of toLocaleDateString.

This code returns a different string between the two versions:

new Date('2014/09/05').toLocaleDateString()

4.2.2: Friday, September 05, 2014
4.2.3: 9/5/2014

I don't see any notes in the changelog that would suggest this behavior would change.

I'm installing nodejs on Ubuntu Precise using the packages from NodeSource.

@ChALkeR ChALkeR added the i18n-api Issues and PRs related to the i18n implementation. label Dec 4, 2015
@ChALkeR
Copy link
Member

ChALkeR commented Dec 4, 2015

/cc @srl295, I guess.

@evanlucas
Copy link
Contributor

Interesting, I'm getting the same on OS X for those versions.

screen shot 2015-12-05 at 8 47 47 am

Can you try running node -pe process.versions.icu on both versions?

@targos
Copy link
Member

targos commented Dec 5, 2015

I have the same result as @evanlucas on Fedora 23

@bnoordhuis
Copy link
Member

If I had to venture a guess, it would be that the NodeSource packages weren't built with ICU support until v4.2.3. "Friday, September 05, 2014" is the formatting for non-i18n builds, "9/5/2014" for small-icu (English only) builds.

It shouldn't affect the binaries from https://nodejs.org/dist/v4.2.2/, those have been built with small-icu for some time now.

@scottbrady
Copy link
Author

Results from running node -pe process.versions.icu.

4.2.2: undefined
4.2.3: 56.1

Looks like something changed with ICU in the NodeSource build of nodejs packages from version 4.2.2 to 4.2.3.

@scottbrady
Copy link
Author

Probably related to this issue: nodesource/distributions#168

Looking at the output of process.config between NodeSource's packaged versions shows the icu library being compiled in starting with 4.2.3.

@ChALkeR
Copy link
Member

ChALkeR commented Dec 5, 2015

I don't think that there is anything actionable here, in both cases the method behaves as it should, given the build configuration. Also, this is not related to builds on nodejs.org. Can we close this?

@scottbrady
Copy link
Author

Looks like a change in NodeSource's compilation process, not a change in Node proper. Closing. Thanks!

@rvagg
Copy link
Member

rvagg commented Dec 7, 2015

Yes, sorry, it's to do with a change that was made in the compilation process. We have been building without ICU until now and just turned it on. Frankly it was an oversight and we were keen to rectify it as soon as we became aware of it. The binaries you get from the NodeSource Linux distributions should now be equivalent to the ones available for download at nodejs.com except they are compiled with the appropriate toolchain for each distribution.

/cc @chrislea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

6 participants