如何设置输入框初始的值
$("#calendar3").asDatepicker({
mode: 'multiple',
multipleSize:100,
outputFormat: 'yyyy-mm-dd'
});
改了一段_initDate的源码搞定了
var date = this.options.date === 'today' ? new Date() : this._parseDate(this.options.date, this.format);
this._date = {};
this._date.currentDate = [new Date(date)];
if (this.mode === 'multiple') {
var arr = [];
if (this.options.date !== 'today') {
arr = this.options.date.split(',');
for (var i = 0; i < arr.length; i++) {
arr.splice(i, 1, new Date(arr[i]).setHours(0, 0, 0, 0))
}
}
this._date.selectedDate = arr;
this._date.focusDate = new Date(date);
this._date.focusDate.setHours(0, 0, 0, 0);
} else {
this._date.selectedDate = [new Date(date)];
this._date.focusDate = [new Date(date)];
}
怎么转换成YYYY-MM-DD格式