I want to display only time from jquery datepicker. my current code is
$(\'#field-start_t_a\').datetimepicker({
showDate:false,
showSecond: true,
t
<script type="text/javascript">
$("#time_field_id").datetimepicker({
dateFormat: '',
timeFormat: 'hh:mm tt',
timeOnly: true
});
</script>
$('.picker').datetimepicker({
dateFormat: '',
timeFormat: 'hh:mm tt',
**timeOnly: true**
});
$(function () {
$('#datetimepicker').datetimepicker({
format:'H:i:s',
inline: true,
sideBySide: true
})
});
try this .worked for me
try a code like this:
<script>
$('#time_input').datetimepicker({
datepicker:false,
format:'H:i'
});
</script>
Just set dateFormat to an empty string dateFormat: ''
$('#field-start_t_a').datetimepicker({
dateFormat: '',
timeFormat: 'hh:mm tt'
});
(this is a little strange that you only want to set time from the datetimepicker, because you can also do $('#field-start_t_a').timepicker();
and only the time options show)
Just adding a simple solution. By adding only this , you can get a time only date picker
$('YOUR_SELECTOR').datetimepicker({
format: "HH:mm"
});
Simple solution, hope it helps.