Search code examples
delphivcl

How should I do a date and time range selection in my Delphi application?


I want the user to be able to specify something like "Tuesday , from 10am till 11am".

Can I do this with one complex control, or would I be better off with 3 separate simpler controls, such as combo boxes, one for day and one each for start/stop times?


Solution

  • Would I be better off with 3 combo boxes, one for day and one each for start/stop times?

    Go for whatever solution doesn't require natural language processing. It's less "cool" and might look a bit obsolete, but I bet it's easier for users because they can do all the selection with the mice and always know they get what they want. Natural language is hard, people might miss-spell things, enter impossible data or confusing data. What do you do if they enter something like this:

    "Marţi, de la 22 la 21"
    

    (intentionally written in non-English, with reversed hours in 24 hour format!). And don't even think about asking non-native-English speakers to WRITE dates in English, it's torture.

    In other words, unless you have Google's ability to process natural languages in multiple languages, go for a plain multi-combo-box setup, with proper editors for each segment: one for date, two for times.