Safari Technology Preview has a date picker but it does not take into account the user's region. In the US they use MM/DD/YYYY but others use DD/MM/YYYY, depending on their region's date format. Nomatter the region, the date picker always shows the format MM/DD/YYYY.
<rdar://problem/71007120>
Created attachment 413096 [details] Date Picker Region
Hi Jeroen! Thank you for the report. The date picker should honor the user's region, based on the value in System Preferences > Language & Region. I've attached a screenshot of the date picker in the Canadian region, which follows the format YYYY-MM-DD (as displayed at the bottom of the System Preferences panel). Would you mind sharing the region for which you are seeing a mismatch?
Created attachment 413101 [details] Showing mismatching regional format vs date picker presentation.
Hey Aditya, I've added the screenshot. Belgium has DD/MM/YYYY as common date format (Even though I'm a YYYY-MM-DD afficionado myself) It's interesting to see it do a YYYY-MM-DD well, and not DD/MM/YYYY, I'll switch and see if it does Canada correctly here.
OK, So even when setting the region to Canada with YYYY-MM-DD as format, then closing and opening Safari (Release 115 (Safari 14.1, WebKit 15611.1.3.5)) it still shows MM/DD/YYYY... Strange.
(In reply to Jeroen Bensch from comment #6) > OK, > > So even when setting the region to Canada with YYYY-MM-DD as format, then > closing and opening Safari (Release 115 (Safari 14.1, WebKit 15611.1.3.5)) > it still shows MM/DD/YYYY... Strange. Hi Jeroen, thank you for sharing the screenshot and trying out more locales. Unfortunately, I'm still unable to reproduce, and I'm also seeing that other users are able to see a picker which matches their locale (example: https://twitter.com/_nb/status/1323567444082921472) In order to try to reproduce, I have a couple of follow-up questions: 1. I noticed your screenshot has "(Custom)" in the region. Do you know why that is the case? Are you also seeing "(Custom)" when trying out the Canadian locale? 2. To the left of the region, there is a list of preferred languages. Would you mind sharing the values in that list?
Thanks for following up, and not just discarding the bug. As per your quetions: 1) It shows (Custom) because I don't use the Belgian region's thousands and decimal separators. I use a comma for thousands and a dot for decimals, like in the US. So it has nothing to do with the date. Also when following the region's decimal notation it does not affect the date format shown in the date picker. 2)I was silly for not showing the languages immediately. I do indeed have my computer's language set to English. And that seems to be causing the problem. Because when I set it to "Nederlands", Dutch (Belgium)... it shows DD-MM-YYYY in the date picker. So the language is the thing, and it shouldn't. Am I right? In the righthand side of the pane you see how the date should be formatted But! When I set it to Dutch (Belgium) shows the date with, not with slashes... In my opinion the date format should adhere to what's set in the preferences as the region's formatting, not the language someone speaks.
Created attachment 413255 [details] Dutch (Belgium) date format
I meant to say it shows the date with dashes, not with slashes.
Do you think, Aditya, this will be followed up on. Or is this a "works as intended"? One might argue that if you're English speaking (or say, a programmer or scientist, or someone working in an international environment) you might prefer your devices' languages to be English. That doesn't mean you don't want to use the date format used in the US, when you live in Europe, or anywhere else for that matter (other than the obvious US of course). I think it's wrong to have the date format follow the language. It should follow the region you live in. Would you agree?
(In reply to Jeroen Bensch from comment #11) > Do you think, Aditya, this will be followed up on. Or is this a "works as > intended"? > > One might argue that if you're English speaking (or say, a programmer or > scientist, or someone working in an international environment) you might > prefer your devices' languages to be English. > > That doesn't mean you don't want to use the date format used in the US, when > you live in Europe, or anywhere else for that matter (other than the obvious > US of course). > > I think it's wrong to have the date format follow the language. It should > follow the region you live in. > > Would you agree? Hi Jeroen, I agree that it would be better to follow the region from a usability standpoint. However, there is also a privacy concern here, since I don't believe we currently expose the user's region (in any manner) to websites. I am actively following-up on this bug, and am in discussion with other members of the team. I will report back here once a decision has been made.
Alright, Good to know you acknowledge the idea of following the region, not the language. Also not sure if the region gets exposed to the website... input type="date" is a replaceable element... afaik the website only gets to see something in the form of YYYY-MM-DD as that is the return value of every browser's date picker. But I don't know much about it. In any case, thanks :)
Hello again, Someone will have to restore my sanity and tell me this got fixed in macOS Big Sur... because after I upgraded and I just checked, Safari Technology Preview 115 _does_ show DD/MM/YYYY in the date picker in my region (Belgium) with English as language. So Aditya, do you know more about this? Or am I seeing things?
(In reply to Jeroen Bensch from comment #14) > Hello again, > > Someone will have to restore my sanity and tell me this got fixed in macOS > Big Sur... because after I upgraded and I just checked, Safari Technology > Preview 115 _does_ show DD/MM/YYYY in the date picker in my region (Belgium) > with English as language. > > So Aditya, do you know more about this? Or am I seeing things? Hello! The format WebKit uses for the date still comes from `navigator.language`, so the change is likely due macOS system changes. If you open Web Inspector and enter `navigator.language`, what is returned? You should still be able to force the previous "MM/DD/YYYY" format by explicitly setting your first preferred language to "English (US)". In this case, `navigator.language` should show "en-US".
I seem to have forgotten to reply to your latest comment. The navigator.language is "en-us". I just want to have it "on record" that it should not follow the language, but the region. Other browsers can do it. I'm not sure if/when it will ever be implemented, because it is not in Safari (only in the tech preview) but just be aware that there will be problems if this is not addressed. It is also not matching what people see in their System Preferences->Language & Region. My Region is Belgium and the dates in the window on the bottom are shown as: Friday, 12 February 2021 at 11:58:33 CET 12/02/2021, 11:58 (the 12/02/2021 is the important one here, it's DD/MM/YYYY, but the date picker in Safari shows MM/DD/YYYY) That's the bug, I don't think anything else needs to be said about it. Regardless of your language, the region has the date format. And the region's date format should be shown. Thanks for the input so far :)
(In reply to Jeroen Bensch from comment #16) > I seem to have forgotten to reply to your latest comment. > > The navigator.language is "en-us". > > I just want to have it "on record" that it should not follow the language, > but the region. Other browsers can do it. > > I'm not sure if/when it will ever be implemented, because it is not in > Safari (only in the tech preview) but just be aware that there will be > problems if this is not addressed. > > It is also not matching what people see in their System > Preferences->Language & Region. > > My Region is Belgium and the dates in the window on the bottom are shown as: > > Friday, 12 February 2021 at 11:58:33 CET > 12/02/2021, 11:58 > > (the 12/02/2021 is the important one here, it's DD/MM/YYYY, but the date > picker in Safari shows MM/DD/YYYY) > > That's the bug, I don't think anything else needs to be said about it. > Regardless of your language, the region has the date format. And the > region's date format should be shown. > > Thanks for the input so far :) Hi Jeroen, Thanks for following up. Unfortunately, we are still unable to honor the region (over language) for privacy reasons. Would you mind expanding on what you mean by "because it is not in Safari (only in the tech preview)"? Are there differences in behavior between Safari and Safari Technology Preview?
I just checked and it is showing the same in Tech Preview as it is in Safari stable... so I don't know what I was seeing back then... maybe it worked for a while in TP, and then it didn't anymore? I don't know... all I know is that now they both show MM/DD/YYYY while, in my opinion, they should be showing DD/MM/YYYY because my region is set to Belgium with the date standard European date format. If the reason for this is privacy... and thus fingerprinting (I assume?) then maybe we could do YYYY/MM/DD to keep everyone (or no-one) happy. In any case, was glad to hear some follow-up on this at least :)