gitHistoryVSCode
gitHistoryVSCode copied to clipboard
setting for date format
Can you add setting to modify date format? Or use system format? In our region we use 24H time format.
Currently we use the language of vscode to format dates.
vscode.env.language
So if vscode is in french for example we will display 24h.
It might be inconsistent to have a system date format if vscode is set to another language.
Happy to look at this though.
What is your language please eg en-GB
F1 / Configure Language / {"locale":"en"}
Where I can find vscode.env.language
?
AFAIK its only programmatic. locale en would show 12h I believe. Remember its node and browser date handling and things aren't quite as . For example vscode doesn't support all locales. What is your system locale?
UI: English (US) Region format: English (US) modified for time format Location: Latvia System Locale: en-us;English (United States)
Because we use toLocaleDateString toLocaleDateString returns 12h for en-US and for example 24h for French I think its an ISO thing.
Your system date settings wouldn't be honoured. I haven't looked into it but I would suspect node (what vscode is based on) wont have access to that setting in a cross platform way.
I think the only way would be
- Use a vscode lang that defaults to 24hr
- Have a setting for 24h in gitHistory that overides the default toLocaleDateString.
VSCode support only "en" and "en-GB". Both "work" as 12H.
GitLens has setting "dateFormat". Hope author of GitHistory will add it also.
Yes I think as GitLens does you have to configure it in the extension as node can't read the 24hr setting from the OS. I'll keep this open as a feature request for a configuration value.
Yes, would really be nice to see real ISO data format yyyy-mm-dd since the American format is useless. Some countries use dd/mm/yyyy and US is mm/dd/yyyy - so impossible to tell unless you have dates after the 12th. You should simply be able to set the format or you should use ISO, which is the only format that makes sense :-)
The language setting did not seem to properly work the way it was expected.
Since it previously uses node package os-locale
to identify the operating system language which may not match vscode display langauge
In PR #433 (or even more specific in commit 427bf71) this should be fixed. This does not resolve the previous request of customizing the date format through configuration for instance. So I will keep it open
for those who want English with but don't want the ridiculous US date format, you can change to en-GB by following the instructions here https://code.visualstudio.com/docs/getstarted/locales It should prompt you to install the en-GB package if it is not already installed
you can change to en-GB by following the instructions here https://code.visualstudio.com/docs/getstarted/locales
It looks like there no longer is an en-GB language pack on the marketplace.
It looks like there no longer is an en-GB language pack on the marketplace.
facepalm
I too would like to be able to change the date format to match my system settings (Region: Australia). I'm less concerned about the time format
Maybe we could just get the default changed to be compliant with international standards if it is too hard to allow localisation. https://en.wikipedia.org/wiki/ISO_8601
@kslstn On vscodium I could still get the English (United Kingdom) language pack from the marketplace. I set --locale=en-gb
as a parameter when launching the app, but the marketplace description mentions another way to set the locale. Not sure how this works for regular vscode.
I am still really looking forward to being able to customize the date and time format and set it to ISO.
os-locale
wouldn't be good enough for many users anyway since it only reads LC_MESSAGES
on POSIX systems. I have a diversity of locale settings, and for my timestamps, I would want LC_TIME
read from my env.
Potentially useful information to implementing the customization: Gitlens is using the Moment.js format.
Based on this issue in VSCode itself, it seems that they are just implementing the date formating directly using the toISO string method per the linked PR and custom string manipulation, perhaps the same thing could be done in this extension now too?
Why don't they / you just fix it so one can choose date format one self?