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

Extensions use incorrect locale (at least for date formatting) #56995

Closed
PikeUK opened this issue Aug 22, 2018 · 6 comments
Closed

Extensions use incorrect locale (at least for date formatting) #56995

PikeUK opened this issue Aug 22, 2018 · 6 comments
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@PikeUK
Copy link

PikeUK commented Aug 22, 2018

Issue Type: Bug

I'm using Windows 10 Pro, set to en-GB.

Extensions aren't using the OS locale for date formatting. I first noticed this in the Hg extension's show history command but it's not specific to that extension.

STR:

  1. Create a New Extension (Javascript) with Yeoman (npm install -g yo generator-code then yo code).
  2. In the activate function in extension.js, change "Hello World!" to new Date().toLocaleDateString()
  3. Press F5 to debug the extension then run the Hello World command.

Expected:
A notification should appear displaying the current date in the OS locale format.

Actual:
A notification appears displaying the current date in en-US format.

If you run new Date().toLocaleDateString() in the Developer Tools console it correctly displays using the OS locale format. I've attached a screenshot showing my OS settings, the incorrect notification date, and the correct Developer Tools console date:

tolocaledatestring

This could be related to or a duplicate of issue #16261 but that seems to be OSX specific.

VS Code version: Code 1.26.1 (493869e, 2018-08-16T18:38:57.434Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz (4 x 3293)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 2.91GB (0.70GB free)
Process Argv C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (4)
Extension Author (truncated) Version
vscode-eslint dba 1.4.14
hg mrc 1.2.3
vscode-apache mrm 1.1.1
code-settings-sync Sha 3.0.0
@vscodebot vscodebot bot added the extensions Issues concerning extensions label Aug 22, 2018
@ramya-rao-a
Copy link
Contributor

@PikeUK Can you try running a simple minimal electron app and see what you get there when you use new Date().toLocaleDateString()?

See https://github.com/electron/electron-quick-start.

Since VS Code is based on electron, I want to rule out any upstream issues first

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Sep 12, 2018
@PikeUK
Copy link
Author

PikeUK commented Sep 12, 2018

I can confirm that new Date().toLocaleDateString() uses the correct locale format in electron:

image

@ramya-rao-a ramya-rao-a assigned sandy081 and unassigned ramya-rao-a Nov 15, 2018
@ramya-rao-a ramya-rao-a added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Nov 15, 2018
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Nov 15, 2018
@sandy081 sandy081 assigned alexdima and unassigned sandy081 Nov 16, 2018
@sandy081 sandy081 removed the extensions Issues concerning extensions label Nov 16, 2018
@sandy081
Copy link
Member

This is nothing to do with extension management... Starting with @alexandrudima to see if it is related to extension host some how

@alexdima
Copy link
Member

This does not work for me in Electron.

image

@alexdima alexdima added upstream Issue identified as 'upstream' component related (exists outside of VS Code) feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Nov 16, 2018
@alexdima alexdima added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@ChrisMaunder
Copy link

Thanks for your understanding

Not understanding at all, to be honest. We have a fundamental issue with dates which may not seem. big deal for a team that uses the format that only the US uses, but for the rest of the world with teams from multiple regions, date format matters. Especially when the default is the worst possible format: x/y/z.

I'm sorry your inbox is a little full. VSCode is an amazing, incredible gift to the world. But this bug seems fundamental and at the same time fairly straightforward to fix.Please don't brush this one under the carpet with a "thanks for understanding".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants