日期选择器初始化 Sombody 时未调用 getDefault_Date() 函数请解释错误在哪里
$('.dtpExpiryDate').datepicker({
numberOfMonths: 1,
showButtonPanel: false,
dateFormat: 'dd/mm/yy',
showOn: 'both',
buttonImage: "images/calender.jpg",
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
minDate: 0,
maxDate: '+20Y',
defaultDate: getDefault_Date()
});
function getDefault_Date() {
var issueDate = $.trim($('.dtpIssueDate').val());
console.log(issueDate);
if (issueDate != '') {
var dateArray = issueDate.split("/");
dateArray[2] += 10;
var defaultDate = "'" + dateArray[0] + "/" + dateArray[1] + "/" + dateArray[2] + "'";
return defaultDate;
} else {
return 0;
}
}