Bootstrap datetimepicker- Uncaught TypeError : Cannot to read property “getTime” of undefined

解决:

在bootstrap-datetimepicker.js中,找到

getDate: function () {
      var d = this.getUTCDate();
      if (d === null) {
        return null;
      }
      return new Date(d.getTime() + (d.getTimezoneOffset() * 60000));
    },

将if中的条件改为:d === null || typeof d === 'undefined'即可。

你可能感兴趣的:(Bootstrap datetimepicker- Uncaught TypeError : Cannot to read property “getTime” of undefined)