Hacker Newsnew | past | comments | ask | show | jobs | submit | TheSisb2's commentslogin

Native datepickers fall apart when you need to handle different date formats as user preferences (not as browser default)


The browser, called the User Agent (UA), IS the program the user uses to interact with a website according to his preferences.


That doesn't always work well in practice. I'm bilingual, and my preference is to use the locale closest to the language of the web site I'm visiting because it feels the most culturally coherent and the least surprising.

I just can't reset my regional settings whenever I switch tabs.


I also find this annoying, but this is due to websites ignoring the browser preferences. The browser supports specifying multiple languages and the website could select the one that the content is native in.


I don’t think there’s a browser setting that lets you use the locale the web site’s language in, is there?


You set all the language you want with priorities and the webserver knows it's own language and serves you the intersection with the highest priority. Or do I misunderstand your question?


I mean the locale, not the language. Many web sites are in a single language and target a specific culture. I want that to be respected by the browser for input type=date and other similar elements based on web site’s language, not the other way around. That’s my preference.


What your browser calls a language, is in fact a locale. You specify en_US, not English.

That would be equivalent to no setting a preferred locale or adding all the available locales.

   <html lang=...


Okay, I already have preferred languages selected: English and Turkish. If I visit a `<html lang="tr">` page I should see date inputs rendered in Turkish culture right? That's not the case unfortunately.

See it for yourself:

lang=en-US -> https://kod.ssg.dev/localetest/

lang=tr-TR -> https://kod.ssg.dev/localetest/index-tr.html


How do you configure Firefox to show date-time picker in 24h format?


Maybe. How many users change the defaults, or even know it’s an option?


When all websites respect their settings and they don't like what the websites do, they will search "how do I change X...", which would point them to the browser settings. If no website respect them, they won't bother. Also these settings come from the OS, which asked the user on install what e.g. date format he wants to use.


Note: they didn’t create lottie, they sorta acquihired the developer who made it and brought the project under their umbrella


Love this. Building a website this way really teaches you why we started having all the complexities in web frameworks today. For certain simple websites like this one, the tradeoffs are worth it. I rebuilt our company website this way too. (Sescollc.com)


It depends on a number of factors, one of which is how the authors perceive the work. Does it stand on its own merits or is it interesting because of the technical decisions? Sometimes it starts as a technical exploration and outgrows itself faster than the author can come to terms with the magnitude of the work.


I appreciate the link, but the tone of this comment is very un-HN. I don’t even see people talk that way about 4chan, which one can argue would deserve it more.


these are very un-HN times


The content on 4chan is almost indistinguishable from X.


Ussername [does|does not] check out


Not sure why this is being downvoted, also curious


Apparently people that support Trump


I really think this conventional wisdom is drastically overblown. Especially in places like this, which are San Francisco liberal adjacent.

Yes, it is not surprising that people who are in the minority in a place with a strong majority viewpoint are less excited to rock the boat. But very few places are like San Francisco.


Venge.io is probably one of the most impressive games I've played in the browser, and was built using PlayCanvas.


I was surprised when this layout worked:

  cabinet 200cm x 92cm top 3cm bottom 15cm scale 5
       50cm     \*        \*        20cm
  \*   drawer   door     door     drawer
  \*   drawer   ^        ^        drawer
  \*   ^        ^        <        drawer
  \*   >        drawer   drawer   <

So I inspected the odd shaped element and noticed it would overflow. Probably fine for your purposes.

Super cool!


Yep, when I was developing this I played with some of these non-intended use cases, even though they wouldn't make sense in reality. Technically, what you did was overlay one module on top of another, with the illusion of there being an L-shaped door.

And it would look very weird, but I suspect it may be possible to assemble the cabinets with these odd shaped doors or drawers...


Unfortunately the illusion breaks if you try to make the L go in the other direction:

  cabinet 200cm x 92cm top 3cm bottom 15cm scale 5
       50cm     *        *        20cm
  *   drawer   door     door     drawer
  *   drawer   ^        ^        drawer
  *   ^        >        ^        drawer
  *   >        drawer   drawer   <
(Also to GP: on here the indentation triggers code blocks where * won't italic, so no need to escape them)


In between barrel files and no barrel files, are unbarrelled files. This is where you have one installable package (i.e.: @cool-lib/core) and create imports from sub-paths like this:

import Button from "@cool-lib/core/button";

import Link from "@cool-lib/core/link";

import Widget from "@cool-lib/core/widget";

This is similar to what lodash does too. Still have more imports, but only one package.json dependency! And the same perf gains.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: