←back to thread

287 points mnemonet | 3 comments | | HN request time: 0.607s | 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 #
1. tshaddox ◴[] No.45893538[source]
That’s probably fine for dates that people have memorized, like their birthday. But it’s certainly not great for something like flight search, where I might know I want to leave in early April on a Friday or Saturday. For that I really need to see a calendar not only to input a date, but to visualize the possible dates for my trip.
replies(1): >>45893609 #
2. padjo ◴[] No.45893609[source]
Input type date shows a calendar: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
replies(1): >>45893789 #
3. lukan ◴[] No.45893789[source]
Yes, but that is not what was recommended here above

"my best advice is to use the damn input type text"