I'm using DateTime Picker and I want to load a only Time picker.
I initialize my input field like this and works good. This let me pick only times jsfiddle:
<div class="input-group date" id="datetimepicker_hour1">
<input type="text" id="hour_from" name="hour_from" class="form-control" />
</div>
$('#datetimepicker_hour1').datetimepicker({
language: 'es',
format: 'hh:ii',
minuteStep: 60,
autoclose: true,
minView: 1,
maxView: 1,
startView: 1
});
If I want initialize this input with a time preselected, JS error occurs:
"Uncaught TypeError: Cannot read property 'getTime' of undefined"
But if I put the input value like this 2017-12-24 13:00, the input time picker have that full value. That works good, but I want that the first value could be only the time, not full datetime.
Here is jsfiddle with a value preloaded. I want that this value could be 13:00:
<div class="input-group date" id="datetimepicker_hour1">
<input type="text" id="hour_from" name="hour_from" class="form-control" value="2017-12-24 13:00" />
</div>
$('#datetimepicker_hour1').datetimepicker({
language: 'es',
format: 'hh:ii',
minuteStep: 60,
autoclose: true,
minView: 1,
maxView: 1,
startView: 1
});