Wednesday, December 4, 2013

Time Spinner Step Values

The spinner widget, as demonstrated here, can be used as time input for the user. For example, using the Globalize library to parse, and increment the time as the user spins up and spins down. However, the demo uses minute increments for each spin - not all that useful if you're filling out a form.

The alternative is to use a more logical step value when it comes to selecting a time value. Like a half-hour or an hour. Here's a modified example of the timespinner widget that uses both of these step values. Keep in mind that a spinner is still just a text input - the user is free to enter any time values they please.