how to display only time in jquery datepicker?

后端 未结 7 1677
庸人自扰
庸人自扰 2020-12-17 10:02

I want to display only time from jquery datepicker. my current code is

$(\'#field-start_t_a\').datetimepicker({
  showDate:false, 
   showSecond: true,

   t         


        
7条回答
  •  醉话见心
    2020-12-17 10:54

    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)

提交回复
热议问题