I'm working on an app and I need to find a solution that lets users select a time duration for hours and minutes. (Example Form: "How long will you need to archive this?" Selection by user: 2 hours | 20 Minutes) Is there a standard component for this? I only found a picker for dates and clocks.
1 Answer
Tom, how granular does this setting have to be?
Especially for less technically savvy users, providing a set of meaningful presets could already do the trick. E.g., here's the menu for setting the alert for a calendar event (taken from Fantastical for Mac):
If you click Custom…, you get to see this:
If that doesn't work, you could simply concatenate static text with either free-form text fields or popup menus, something like this:
Archive for [number] hours and [number] minutes
Note, though, that the error handling for free-form text fields can be annoying, because 2 hours and 65 minutes
wouldn't sense. :)
Finally, a quick tip: unless this violates existing styles in your application, consider avoiding verbose questions such as "How long will you need to archive this?" They typically make scanning a set of similar questions more tedious, because the first few words per question usually aren't different enough.
Instead, keep it more concise, as mentioned above: "Archive for…"
Good luck!