7 ms·
It looks like the date is displayed in the US format mm/dd/yyyy which is, of course, most unnatural to all other countries. Is this customizeable, or is it auto
by snitko 9y ago
It looks like the date is displayed in the US format mm/dd/yyyy which is, of course, most unnatural to all other countries. Is this customizeable, or is it automatically adjusted depending on the language preferences in the browser? If it's the latter, it's not cool - my preferred language for the browser is English, but I hate the US date display format with passion.
EDIT: oh I see, automatically adjusted, but not configurable. Bad choice it is, then.
EDIT2: I mean, there are so many more better and easy solutions to that problem. You could display a date with a month name in the selected language - "Oct 1, 2017" - or start with a year "2017-10-01" which would be instantly recognizable by anyone regardless of the country.
- Aeolun 9y agoOnly in the sense that people won't be taught to use sane date formats. I don't see any issue with allowing someone who wishes to use the weird format to have their way. Edit: If you downvote it, be nice enough to let me know what you disagree with.
- Majestic121 9y agoThe downvotes are probably because you seem to miss the point of the parent. The issue is not about the possibility to have a weird format, the issue is that the format is automatically adjusted to the "weird" one that a lot of people don't like, and that it is not easily configurable.
- Yaggo 9y agoAt least on macOS it seems not to be automatically adjusted. It still displays me the illogical mm/dd/yyyy format, despite my Firefox having 'Finnish' on top in language settings. Ideally the application should read the system regional setting and use that. For example, my macOS uses English as language and Finnish as region. (I've no idea if the system provides an API for reading regional settings, though.)
- metafunctor 9y agoConfirmed. The MacOS system, of course, provides APIs to get language and locale settings (for dates, number formatting, etc.) separately. The JavaScript environment, on the other hand, doesn't really have any good APIs that properly separate preferred language from other things like units (metric vs. imperial), formatting dates and times, currencies, and so on. I was hoping this would be an improvement to the state of JavaScript wrt. locales. Sadly, it looks like this build of Firefox Nightly still doesn't do dates correctly on MacOS, and this is just as broken as everything that came before it. I have language, dates, number formatting, and everything set up just the way I like it in the OS settings, why the web/JS world just doesn't use those settings is beyond me.
- masklinn 9y ago> The JavaScript environment, on the other hand, doesn't really have any good APIs that properly separate preferred language from other things like units (metric vs. imperial), formatting dates and times, currencies, and so on. You could implement the locale-less Intl.DateTimeFormat or Intl.NumberFormat such that they get the current formatting settings regardless of locale data.
- metafunctor 9y agoHere's the problem: given that I have already configured date and time formats (among other things) in my operating system, like everybody else has, how do I access those settings and pass them on to DateTimeFormat?
- masklinn 9y ago> Here's the problem The browser ought do that automatically, that it does not is the issue at hand. I was just pointing out that the Intl API does not seem to preclude implementing this behaviour, it still needs to be implemented. Which first means that it should be reported to Firefox's bug tracker (I have not seen a single link to FF's bugzilla in any of the subthreads).
- maggit 9y agoThat's an awful shame. I can't really see myself using this when authoring websites as long as it has that behaviour. If I am authoring a Norwegian web site, the date format must be Norwegian, regardless of the user's preferred locale.
- alkonaut 9y agoI can see how customizable locale/formatting would be important, but would it really matter if a US visitor to the Norwegian website saw a mm/dd/yyyy date instead of the yyyy-mm-dd that would be shown to those with norwegian locale? The important thing seems to be that the user understands the format. This is client side rendering after all.
- maggit 9y agoIt is important that a Norwegian visitor with a browser configured to prefer en-US [1] would see the entire web page in the same locale. Why should _parts_ of the web page localize to a different locale than other parts? The standard Norwegian date format is DD.MM.YYYY, _easily_ confused with MM/DD/YYYY. Why is it a feature to include this confusion? [1]: This is pretty common, either deliberately or by accident. If you actually want to serve content localized in multiple ways (eg. you want to serve both an English and a Norwegian version) you have to sidestep browser localization anyway and offer the user a way to select which version they want.
- alkonaut 9y ago> It is important that a Norwegian visitor with a browser configured to prefer en-US [1] would see the entire web page in the same locale. Why should _parts_ of the web page localize to a different locale than other parts? Completely agree - that should not happen. Consistency is most important. So if a Norwegian user has an en-US browser and the rendering uses this control which uses default browser locale then all date rendering in all markup has to be en-US. That is: this control can't be used on a web site unless the site already uses browser locale for all date input and output. If the web page already has custom date formatting (e.g. the user chooses locale/format in the site preferences) or if the page has elements rendererd DD.MM.YYYY already from the back end - then this control can't be used. (Also: TIL Norway doesn't use ISO 8601 like Sweden. I honestly thought ISO 8601 was norm in Europe, but apparently mostly in Sweden).
- robin_reala 9y agoGrab the en-GB Firefox release? You get dd/mm/yyyy then. https://www.mozilla.org/en-GB/firefox/all/#en-GB https://www.mozilla.org/en-GB/firefox/all/#en-GB
- jochung 9y agoWhy is this read off the firefox locale when my system has perfectly decent localization capabilities set up just the way I like it? (US English, 24h, YMD) This seems like another case of the browser becoming an OS within an OS.
- ubernostrum 9y agoFor the same reason sites end up implementing language switchers despite your browser having a way to set your preference and send it in an HTTP header.
- oneeyedpigeon 9y agoWhich Chrome seems to think is a setting that every single application needs to control itself, rather than being a system-wide config.
- jochung 9y agoHuh? How is a localization being tied to a browser bundle vs OS remotely the same as a website offering the ability to view content in different languages? I can change my OS locale settings just by opening up a panel. Firefox wants me to install a new official locale or a new browser bundle to do the same. Btw, content language is not a locale preference, it's contextual. Browsers could have a standard dropdown in their UI to change that header on the fly, sure, but that wouldn't make language selection unnecessary. Take something like Wikipedia, the contents are widely different across languages, and switching is common for multilingual readers.
- ubernostrum 9y agoThe common reason here is that among people who aren't the sort to post on Hacker News, knowledge of how to change these things -- in the operating system for locale, in the browser for preferred languages -- or even knowledge that these things can be changed, is uncommon. See also: "you can't fix the user".
- mrmondo 9y agoYeah I thought that was really confusing! I would have expected that for countries that commonly read left to right and count from small to big the format of day(smallest common date unit)/month/year(largest common date unit) would at least be a sensible default if unable to detect the exact clients country standard, failing that the ISO of YEAR-MONTH-DAY would be fine but not jumbling it up like this and putting the day between the month and year - I know my comment could sound a bit ‘flamey’ but I’m purely interested / invested from the point of view of logical or biology, I don’t care about ‘X country does Y better’.
- afafa12 9y agoThat would be the case if not the fact US used date format different to everybody else. Is 01/05/2000 1st of May or 5th of January? The answer is: cannot tell without context!
- moogly 9y agoThe company I work for settled for the presentation format "23 Oct 2017" for this reason, which is also why we can't use these standard controls :/
- vog 9y agoNote that the format "2017-10-31" is also an ISO standard (ISO 8601), so when in doubt, this is the most sane default you can have.
- Crontab 9y agoAgreed. I personally use it everywhere I can because it makes it easy to sort anything that is date/time based.
- fpoling 9y agoFrom my experience people outside IT or science may not have recognize ISO format as a date. Using US ordering with a word for the month in the native language can be safer default.
- Manishearth 9y agoYou have to download the en-GB localized browser to get a different date ordering. Firefox serves localized downloads by default, and you can also manually get the right one (IIRC it lets you override it on the download page)
- vim_wannabe 9y agoI'm confused, if the operating system is set to use some date format why not use that? You don't need to even reveal the format to Javascript since the input should work without JS. Language preferences are a totally separate thing, although they could be used as a fallback if date format is somehow not offered by the operating system. E.g. de-CH for a swiss date format, de for a german date format.
- b212 9y agoI'm wondering how difficult (if not impossible?) it would be to change the format in the US. It makes no sense whatsoever and the US seem to be the only place in the world to use mm/dd/yyyy excluding a few countries in Africa (and even there it's not the most popular format): https://i.guim.co.uk/img/static/sys-images/Guardian/Pix/pictures/2013/12/15/1387125446928/835093f2-abba-406e-9856-46a741c53874-620x421.png?w=620&q=55&auto=format&usm=12&fit=max&s=a992d570c7c0a8da008b8fdf8c553cf9 https://i.guim.co.uk/img/static/sys-images/Guardian/Pix/pict... https://en.wikipedia.org/wiki/Date_format_by_country https://en.wikipedia.org/wiki/Date_format_by_country
- tankenmate 9y agoWelcome to the world of middle endian. And for this reason the ISO standard is yyyy-mm-dd, big endian just like writing numbers; and it sorts (numerically not lexigraphically) properly too!
- ClashTheBunny 9y agoIt sorts lexigraphically if it is zero padded.
- jwandborg 9y agoOnly as long as you zero-pad the year according to the maximum year in your list. I'll dub this "the year 10000" problem.
- continuational 9y agoBy the year 10000, hopefully terrestial time is long obsolete, and replaced with whatever makes sense for a multi-planet species.
- pjmlp 9y agoAssuming that is anyone left that cares about it.
- baby 9y agoWhy don't they use the ISO standard for displaying dates? month-day-year makes no freaking sense. Plus there are no way to distinguish month-day to day-month in a lot of cases
- BLanen 9y agoBecause you didn't actually read the article.
- codeulike 9y agoUm ... Displaying dates based on locale of client has been the standard for most software for decades. Why call out Firefox for this, now?
- rypskar 9y agoBecause this is not displaying dates based on the locale of the client, but displaying locale based on the language of the application.
- cfstras 9y agoObligatory XKCD: https://xkcd.com/1179/ https://xkcd.com/1179/ I agree, though. Browsers allow users to customize fonts and zoom levels, so the date formats should probably be a user-configurable setting, too.
- BrandoElFollito 9y agoThe last one is actually the ISO norm. There was of course an xkcd on that subject as well.