←back to thread

286 points mnemonet | 1 comments | | HN request time: 0.343s | source
Show context
Muromec ◴[] No.45893136[source]
After dealing with datepickers for (checks notes) two decades, my best advice is to use the damn input type text with a placeholder showing a format, then saving it as a string in whatever that ISO that makes sense is called.

Everything else is asking for endless trouble and pain with browsers, a11y, locales and what not. Also, may the God allmerciful save you from the cancer that custom components are, let whoever invented this wipe his ass with fiberglass insulation for the end of times.

Don't get fancy and you will not fall down 10 rabbit holes that datepickers are.

replies(4): >>45893476 #>>45893538 #>>45894154 #>>45894848 #
dotancohen ◴[] No.45894848[source]
No matter what placeholder text you put, you can not trust that 3-9-1980 is the same date for your user as it is for you.
replies(1): >>45901541 #
1. Muromec ◴[] No.45901541[source]
Which is why locale settings exist and are important to get right before asking for user input