1.只显示年月日

$( ".datepicker").datepicker({
        needDay:true,
        changeMonth: true, //显示月份
        changeYear: true, //显示年份
        showButtonPanel: true, //显示按钮
        dateFormat: 'yy-mm-dd', //日期格式
    });

2.只显示时分秒(需要引入时间插件文件。1.【jQuery-Timepicker-Addon/jquery-ui-timepicker-addon.js】2.汉化【datetimepicker/js/jquery.ui.datepicker-zh-CN.js.js】)


$('.datepicker-times').timepicker({
        
        showButtonPanel: true, //显示按钮
        timeFormat: "HH:mm:ss",
     
    });
 

3.显示年月日时分秒,

$('.datepicker-times').datetimepicker({
        needDay:true,
        changeMonth: true, //显示月份
        changeYear: true, //显示年份
        showButtonPanel: true, //显示按钮
        timeFormat: "HH:mm:ss",
        dateFormat: "yy-mm-dd"
    });

官网:http://trentrichardson.com/examples/timepicker/#tp-examples

相关文章:

  • 2021-09-21
  • 2022-12-23
  • 2021-05-21
  • 2021-11-21
  • 2022-01-08
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案