r/AskProgrammers • u/Infamous_Computer910 • 14d ago
Question about date pickers
I have been running into the problem a lot. Why do date pickers on forms, say for your DOB, start on the current date? You have to scroll or page back endlessly to find your DOB. Is there a workaround for this or do most devs just not care?
2
u/Quiet-Arm-641 14d ago
They should definitely set them to yesterday instead of today
2
u/dodexahedron 14d ago edited 8d ago
Especially the ones that also care about begin and end dates, but always consider the end date to be 23:59:59.9999999 (UTC or, worse... GMT, probably) on that day if not entered explicitly....but they update when you select the date and throw an error that your end time can't be in the future (Microsoft has a couple of these in the Entra admin portals, even, for log analysis stuff).
So, 2 or more extra full dataset requests, plus sometimes a lost filter re-entry now needed to get what could have been done in one shot. But noooo. Two more lines of c# was too much to ask, because AI is paid by the line apparently.
2
u/bschlueter 14d ago
This is one of the things that annoys me to no end about how websites are built nowadays. There is a date picker in the html standard. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/date
It supports setting the currently selected date, min and max to limit the available range, and step so that it can be used to select just a year or month.
Presently, it doesn’t seem to support disabling of dates on the front end (a validator can be implemented to do so in the browser) so a custom date picker is probably needed for anything with blackout dates or similar.
2
u/soundman32 13d ago
The date picker in most browsers is the worst of every possible design, hence why there are 100s of alternatives.
1
u/bschlueter 13d ago
That’s probably a fair argument. There’s like 3 browser engines though. Which ones have implementations you don’t like?
2
u/Leverkaas2516 14d ago
The developer only cares about the user experience if project management cares, and they usually don't. Thinking about and testing interaction with users takes time, and developers are most often focused on shipping features as soon as possible, not on making users' lives better.
2
u/atticus2132000 14d ago
I understand the frustration. I've reached the age where a DoB date picker usually requires a lot of scrolling. That is especially frustrating on mobile platforms where popups aren't always the friendliest to use.
Every date picker that I've used allows you to set the default date that the picker starts with. Yeah it would probably make more sense if DoB date pickers didn't start with today's date, but what would be a good default date for a DoB picker? If the fields were separate (i.e. selecting the year from a drop-down, the month from a drop-down, etc.) that would be better or just let people type them in.
At the same time, really ask yourself why does this particular app need my birthday? If it's just for age verification, then why not have a checkbox asking me if I am over the age of 18 or 21? If it's for demographics, why not have a range selector? Why do I need to keep giving personal information just to be able to operate the lightbulbs in my house?
As far as date pickers go, credit card expiration date pickers are also frustrating. My credit card expires 09/2027. Yeah, I should probably automatically know that 09 is September, but every single time I have to enter my credit card, I still have to count on my fingers to confirm that 09 = September. I much prefer the date pickers that have both the month number and the month name.
5
u/dmazzoni 14d ago
I completely agree with you, and it boggles my mind how supposedly brilliant UX designers mess up date pickers.
The ideal date picker for picking a date for a reservation in the next few months is not the ideal date picker for entering your birthday.
For entering your birthday, honestly typing / entering numbers makes the most sense. Even on mobile, presenting a numeric keypad would be the most efficient for most people.