我正在尝试从另一个 onChange 播种一个字段,几乎就在那里,但是当我尝试从 onSet 中访问“endDate”时抛出错误,显然我无法从函数中访问它?:
var endDate = $('.end-date .datepicker').pickadate({
formatSubmit: 'yyyy-mm-dd'
})
// Would like date from here copied over to endDate on change
var startDate = $('.start-date .datepicker').pickadate({
formatSubmit: 'yyyy-mm-dd',
onSet: function(endDate) {
console.log('Want to set endDate to - ' + this.get('select', 'yyyy/mm/dd'));
endDate.set('select', this.get('select')); // This line is wrong ..
}
})