在bootstrap timepicker中使用24小时时间 [英] Using 24 hour time in bootstrap timepicker
问题描述
嗨我在bootstrap上使用 http://eonasdan.github.io/bootstrap-datetimepicker/ ,特别是示例4号。
Hi im using http://eonasdan.github.io/bootstrap-datetimepicker/ on bootstrap, specifically example number 4.
我添加了这个属性来取消PM的东西,并且可以在小部件上使用24个系统:
I added this property to take away the PM thing and be able to use 24 system on the widget itself:
格式:'hh:mm',
format: 'hh:mm',
但是我可以说我选择16:小部件上的00它在04:00显示在输入本身而不是16:00。
But lets say I pick 16:00 on the widget it shows up at 04:00 on the input itself as opposed to 16:00.
我在文档中找不到任何关于此的内容,所以如果有人知道这个问题的解决方案真的很感激。
I could not find anything in the documentation about this so if anyone knows a fix for this it would be really appreciated.
谢谢。
推荐答案
编辑:这个帖子有比这个更好的答案。在我回答的时候,我只是掌握了JavaScript。具体来说,请参阅这些 两个。
There are much better answers on this thread than this one. I was just getting the hang of JavaScript at the time I answered. Specifically, see these two.
如果你在该脚本的开发版本中搜索,那么有一个名为 use24hours
的函数对于值为true或false。
If you search within the development version of that script, there's a function called use24hours
that looks for a value of either true or false.
添加 use24hours:true
可能会为您完成这项工作。像这样:
Adding use24hours:true
might do the job for you. Like so:
$(function () {
$('#datetimepicker5').datetimepicker({
use24hours: true
});
});
这篇关于在bootstrap timepicker中使用24小时时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!