Sujon Chondro Shil
Sujon Chondro Shil

Reputation: 103

How to get only time value from Bootstrap datetimepicker

In the code below, StartTime is 05/29/2017 1:00:00 PM.

But I want StartTime to be 1:00:00 PM.

HTML

<div class="form-group">
     <label>From</label>
     <input class="form-control " id="StartTime" type="text" name="StartTime"/>
</div>

JS

$('#StartTime').datetimepicker({
    format: 'LT'
});

Upvotes: 0

Views: 3364

Answers (2)

this.girish
this.girish

Reputation: 1306

this is how you can disable date

  $(function () { 
  $('#StartTime').datetimepicker({
    format: 'LT',

    });
});

Upvotes: 1

Red Devil
Red Devil

Reputation: 176

try this:

$("#StartTime").datetimepicker({
           format: 'hh:ii',
           startView: 1,
           pickDate: false,
           autoclose: true 
        }).on("show", function(){
        $(".table-condensed .prev").css('visibility', 'hidden');
        $(".table-condensed .switch").text("Pick Time");
        $(".table-condensed .next").css('visibility', 'hidden');
    });

Upvotes: 0

Related Questions