O'Reilly logo

jQuery UI Cookbook by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Formatting time for local cultures

The spinner widget utilizes the Globalize jQuery project; an effort to standardize on data formats according to the local culture. The spinner widget utilizes this library to format its values. For example, specifying the numberFormat and culture options allow us to use the spinner widget to display currency values according to local culture. However, currency is just one value that we like to format locally; time is another. We can use the built-in Globalize capabilities only to an extent in the spinner widget for displaying time values. A little more work is required on our part to extend the widget to properly allow for time values. In fact, let's create our own time widget, based on the spinner.

How to do ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required