jQuery UI Spinner几分钟 [英] jquery ui spinner for minutes

查看:142
本文介绍了jQuery UI Spinner几分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用jQuery用户界面微调器输入几分钟.目前它的工作范围是0-60,但我希望单位数字是00,01..09两位数字.

根据文档,我应该使用全球化插件并设置numberFormat:'mm '但这引发了错误.在控制台中,我查看了全球化js,"mm"选项位于"formatDate"内部.所以我尝试了:

$('.minute-spinner').spinner({culture: "en-US",formatDate: "mm"});

但是什么也没做.有谁知道如何使微调框始终显示2位数字?

解决方案

不幸的是,.spinner()没有formatDate选项.

尝试一下:

$('.minute-spinner').spinner({ numberFormat: "d2" });

演示: http://jsfiddle.net/dirtyd77/SA7Gk/

希望这会有所帮助,如果您有任何疑问,请告诉我!


参考:


更新:

这里是对 globalize.js 的引用. /p>

Im trying to use the jquery ui spinner for a minutes input. Currently it works 0 - 60 but I want the single digits to be 00,01..09 double digits.

According to the docs I should use globalize plugin and set numberFormat: 'mm' but that threw an error. In the console I looked at globalize js and 'mm' option is inside 'formatDate'. So I tried:

$('.minute-spinner').spinner({culture: "en-US",formatDate: "mm"});

but that didn't do anything. Anyone know how to make a spinner always show 2 digits?

解决方案

Unfortunately, .spinner() does not have a formatDate option.

Try this:

$('.minute-spinner').spinner({ numberFormat: "d2" });

DEMO: http://jsfiddle.net/dirtyd77/SA7Gk/

Hope this helps and let me know if you have any questions!


REFERENCES:


UPDATE:

Here is the reference to globalize.js.

这篇关于jQuery UI Spinner几分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆