bootstrap datepicker Uncaught TypeError: Cannot call method 'split' of undefined问题

这个问题主要是由于date对象不是字符串,不能使用 split 函数,简单处理一下,转换成字符串就可以解决问题:

++++++++++++++++++++++++
parseDate: function(date, format) {
var parts = date.split(format.separator), <=== 出错的地方
++++++++++++++++++++++++

改成:

++++++++++++++++++++++++
parseDate: function(date, format) {
date = date + ""; <==== 加上这一行
var parts = date.split(format.separator),
++++++++++++++++++++++++

 

你可能感兴趣的:(Datepicker)