-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Please respect region time format on new tab #1308
Comments
I would like to work on this issue if it's available. |
@kartik-budhiraja that would be awesome. I've self assigned the issue so that no one else works on it and then submit a PR with the fix. |
Is anyone still working on this? Otherwise I would like to give it a go. |
I planned to work on it, but unfortunately, cannot any soon, so you are good to go from my side. |
Alright, great. I'll have a look then. |
I've took a look at this. Sorry I've never developed React and have no idea how you would put the solutions structurally together. Therefore no pull request. It seems you're using Intl.React to solve internalization. Looking at the examples from Intl.React, a locale should be provided or else it will always fall back to default. The counter part to this is how locales are being loaded for that package. The following documentation gives me a hint, but I think something in that regard has already been done in this project. One other thing to note here is that system locale is preferred, because my browser is in english but my system locale is something else. |
Yes, this is pretty much what I've discovered as well -- the issue seem to be in the brave-ui code. |
I don't know if this is still the problem, but if you wont to change 12h to 24h format, you can change to your local language in settings then put it on top, Brave will change time format. I guess it has something to do with navigator.language option. |
@mladenko Yes, but that would go against the original issue, where the user shouldn't have to change the browser language. At least for my case when trying it, I had to change the language from English to my mother tongue for the clock change to happen, perhaps I did something wrong? On a side-note, I think I have a working solution here, so I will hopefully make a PR soon (depending on how the PR for brave-ui goes). |
I changed my language to English United Kingdom but still I have 12h format clock on new page. What else did you change except this? Thanks |
Make sure you put it on top, and that you click on those three dots to also use it for Brave user interface. I dont know if both these actions are necessary, but I did it and it works. |
@spoike that option does exist in Nightly and will be working its way to the release channel 😄 Also available in the bottom right (on Dev and Nightly I believe): |
Thanks all for the multiple ideas here. While it's possible to get the time format based on system locale, in my investigation, it's impossible, at least via web APIs, to detect the time format alone, which means that if your system is using a locale that defaults to 24-hour, then our NTP will display the 24-hour clock. i.e., if your system defaults to en-US, switching to the 24-hour system will take no effect. Same applies for the opposite, changing to pt-BR (Brazilian Portuguese) will always display a 24-hour clock. We do have plans to allow users to customize the clock, but this is a matter for a different issue. As my comment here, I'm going to update this issue test plan so we can have a better approach to time than what we have right now, otherwise we would need to label this as |
fix brave/brave-browser#1308 this change allows users with 24-hour format to see time on NTP the same way their system defined. defaults to whichever locale user defined on their system settings.
LOOKING GOOD. |
Verified passed with
Verification passed on
Verification passed on
|
This is still an issue on Windows 10 Pro 1909 (18363.476) in Version 1.0.0 Chromium: 78.0.3904.97 (Official Build) (64-bit). At 15:18 the new tab page is still showing 3:18. |
Perhaps people dosnt want to change from US to UK. Like me, i want that every new bits are there on my builds, so im not want wait for uk translations. Thats why i and many others want to use US language on primary everywhere but still want to change date formats and such to match our own ones. This isnt just a brave problem but wide ratio to other applications too. why? it is a problem by design and then by devs who design software, they dosnt even think about this :/ |
same here, on linux. won't it be a lot easier to make it a option on the new tab definitions? |
For folks experiencing this problem, check out #7951 and give it a +1 😄 |
Test plan
See brave/brave-core#3256
Description
New Tab dashboard shows time in AM/PM, even though system settings are set to 24h time.
No similar issues in
brave-browser.
Similar issues in
brave-laptop
:(All closed without solution)
Steps to Reproduce
Actual result:
Expected result:
Time should match locale time (24-hour if locale defaults to it, such as pt-BR suggested in the test plan above). Switching back to locales that default to 12-hour (such as en-US) should update accordingly.
Reproduces how often:
Always
Brave version (chrome://version info)
Brave | 0.55.6 Chromium: 70.0.3538.16 (Official Build) dev (64-bit)
Revision | 16ed95b41bb05e565b11fb66ac33c660b721f778-refs/branch-heads/3538@{#306}
OS | Mac OS X
JavaScript | V8 7.0.276.9
Reproducible on current release:
Yes, reproducible also on
browser-laptop
.Additional Information
After digging through the source code here:
https://github.com/brave/brave-core/blob/master/components/brave_new_tab_ui/components/app.tsx
I can see that
brave-ui/old/clock
is being used:https://github.com/brave/brave-ui/blob/master/src/old/clock/index.tsx
Which renders AM/PM time directly.
The text was updated successfully, but these errors were encountered: