I have a Stateless Form, the on click section has the below script.
And the function has the below script.
Read More
- if (input.End > input.Start)
- {
- myDateList = List:Date();
- myDateList.add(input.Start);
- alert(thisapp.date.recursive(input.Start, input.End, myDateList));
- }
- else
- {
- alert("start >= end");
- }
And the function has the below script.
- list date.recursive(date start, date end, list:date myDateList)
- {
- if (input.end >= input.start)
- {
- dateDiff = (((input.end - input.start) / (1000 * 60 * 60 * 24))).toLong();
- if (dateDiff > 7)
- {
- myNewStart = input.start.addDay(7);
- input.myDateList.add(myNewStart);
- myNewList = thisapp.date.recursive(myNewStart, input.end, input.myDateList);
- }
- else
- {
- input.myDateList.add(input.end);
- }
- }
- return input.myDateList;
- }
Read More