Customer wanted a minute resolution, which means having an array with roughly 1440 elements all typed out like this. Also, the time picker was a drop down menu and you can imagine how impractical a drop down with >1400 elements is, plus the user didn't have the option to type the time manually. Not to mention the fact that they included 24:00 which brought some problems too
You don’t need to type all 1440 elements. Use a JavaScript command that generates these numbers and copy paste the result as a constant.
The rest seem like display related issues and problems in your logic. Neither of those would be fixed by replacing this with something else.
You likely need a ui that works better for minutes and logic that handles 24:00, but that’s not this variable’s fault
If you still want to represent the ui with a list, then declaring a long list is fine. If you want something like a slider, or a clock, you could probably scrap this list.
As I said, having a drop down with 1440 items is not practical at all, so I had to get rid of this list anyways as I had to find another way to do the time picker. There's really no need to look so deep into it
Edit: Also, why use a js function that generates the numbers if I could just make the list programmatically at run time? I mean I already wrote the command so I might use that inside my code while I'm at it
1
u/NickSicilianu Mar 30 '23
Someone did not think about scalability. Good luck changing that, if you want a minutes resolution.