を理解されるであろう。
1.ユーザーを2つの日付をクリックします
2. 2つの変数として保存します(startDate、endDate)
3.youループます
var numberOfDaysToAdd=0
var startDate;
var endDate;
var dateCheck=startDate;
var DatetoAddInArray = startDate;
var array = [];
while(DatetoAddInArray!=endDate){
//every time you check if the date is equal to the endDate
//if is not you add it in the array with the dates and then
//you increase the index.
//the while loop ends when you find the end Date
//You can change your code to add or not the start and the end dates
numberOfDaysToAdd++;
DatetoAddInArray.setDate(DatetoAddInArray.getDate()+numberOfDaysToAdd);
array[numberOfDaysToAdd-1]=DatetoAddInArray;
}
上記は、終了日に開始されてからのすべての日付を格納するための簡単な方法である可能性があります。
(!)datePickerを使用してstartDateをクリックし、startDateの前にあるendDateをクリックできる場合は、正しい範囲を選択するようにユーザーに警告する必要があります。
ありがとうございました。