Open JackieLs opened 7 years ago
I created two versions of the "limit" - one called "startLimit" and the other called "endLimit":
startLimit: [{
type:'fromto',
from: new Date().setFullYear(new Date().getFullYear - 1),
to: new Date().setFullYear(new Date().getFullYear + 1),
}],
endLimit: [{
type:'fromto',
from: new Date().setFullYear(new Date().getFullYear - 1),
to: new Date().setFullYear(new Date().getFullYear + 1),
}],
I then created a method that is called when the start_date field is changed:
checkEndDate(){
var e = this;
// If end date is earlier than start date, change end date to start date
if(e.event_end.time < e.event_start.time){
e.event_end.time = e.event_start.time;
}
e.endLimit[0].from = (e.event_start.time != '' ? new Date(e.event_start.time) : new Date().setFullYear(new Date().getFullYear - 1));
}
@JackieLs 如何解决?
@geekgirlcoding
I also encountered the same demand, but according to your method and did not take effect, you can look at your code in more detail?
I have a demand: a startTime && a endTime ,when startTime picked the endTime should not > the startTime, off course if endTime picked the startTime should not < the endTime , How Should I do?.....when I declare @change function to return false the value in the input also changed....