不灭的焱

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2017-10-29 10:26:59  修改时间:2024-04-18 18:39:03  分类:前端/Vue/Node.js  编辑
$('#<!--{$inputId}-->').datetimepicker({
  todayHighlight: true,
  format: "YYYY-MM-DD<!--{if $isTime}--> HH:mm<!--{/if}-->",
  pickTime: <!--{if $isTime}-->true<!--{else}-->false<!--{/if}-->,
  minuteStepping: <!--{$minuteStepping}-->,
  language: 'zh-CN',
  inputMask: true,
  inline: true,
  sideBySide: true,
  pickerPosition:'bottom-right'
}).bind('dp.change', function(e) {
  var d = new Date(e.date);

  console.log(d.getFullYear()); // 年
  console.log(d.getMonth() + 1); // 月
  console.log(d.getDate()); // 日期

}).next().on(ace.click_event, function(){
  $(this).prev().focus();
});

 

 

参考:

http://stackoverflow.com/questions/39247347/bootstrap-datetimepicker-dp-change