Using 24 hour time in bootstrap timepicker

前端 未结 15 914
太阳男子
太阳男子 2020-12-03 13:55

Hi im using http://eonasdan.github.io/bootstrap-datetimepicker/ on bootstrap, specifically example number 4.

I added this property to take away the PM thing and be a

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 14:15

    EDIT: 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.

    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.

    Adding use24hours:true might do the job for you. Like so:

    $(function () {
        $('#datetimepicker5').datetimepicker({
            use24hours: true
        });
    });
    

提交回复
热议问题