FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: set locale for datetime-change-notify test by Lxxyx · Pull Request #38741 · nodejs/node · GitHub

/ node Public

test: set locale for datetime-change-notify test - #38741

Closed
Lxxyx wants to merge 1 commit into
nodejs:masterfrom
Lxxyx:fix-datetime-test
Closed

test: set locale for datetime-change-notify test#38741
Lxxyx wants to merge 1 commit into
nodejs:masterfrom
Lxxyx:fix-datetime-test

Conversation

Lxxyx commented May 20, 2021
edited
Loading

Copy link
Copy Markdown
Member

The time zone output by toString() will change with user's language, use toLocaleString() to set the time zone.

This test will fail on a computer with the language set to Chinese.

Example:

use toString()

new Date().toString() 
// output: Thu May 20 2021 05:18:38 GMT+0000 (协调世界时)

use toLocaleString()

new Date().toLocaleString('en-US', { timeZoneName: 'long' }); 
// output: date 5/20/2021, 5:24:25 AM Coordinated Universal Time

The time zone output by toString() will change with user's language, use toLocaleString() to set the time zone.
github-actions Bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 20, 2021
Lxxyx added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. and removed needs-ci PRs that need a full CI run. labels May 21, 2021

nodejs-github-bot commented May 21, 2021
edited by jasnell
Loading

Copy link
Copy Markdown
Collaborator

jasnell added the fast-track PRs that do not need to wait for 48 hours to land. label May 21, 2021

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @jasnell. Please 👍 to approve.

jasnell commented May 24, 2021

Copy link
Copy Markdown
Member

Landed in 80ed0a6

jasnell closed this May 24, 2021
jasnell pushed a commit that referenced this pull request May 24, 2021
The time zone output by toString() will change with user's
language, use toLocaleString() to set the time zone.

PR-URL: #38741
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
danielleadams pushed a commit that referenced this pull request May 31, 2021
The time zone output by toString() will change with user's
language, use toLocaleString() to set the time zone.

PR-URL: #38741
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
danielleadams mentioned this pull request May 31, 2021

Copy link
Copy Markdown
Member

Depends on #38642.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. fast-track PRs that do not need to wait for 48 hours to land. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL