Quantcast
Viewing all articles
Browse latest Browse all 183369

Re : Complex List Requirement

I have a Stateless Form, the on click section has the below script. 
  1. if (input.End  > input.Start)
  2. {
  3.     myDateList = List:Date();
  4.     myDateList.add(input.Start);
  5.     alert(thisapp.date.recursive(input.Start, input.End, myDateList));
  6. }
  7. else
  8. {
  9.     alert("start >= end");
  10. }

And the function has the below script. 

  1. list date.recursive(date start, date end, list:date myDateList)
  2. {
  3.     if (input.end  >=  input.start)
  4.     {
  5.         dateDiff = (((input.end - input.start)  /  (1000  *  60  *  60  *  24))).toLong();
  6.         if (dateDiff  > 7)
  7.         {
  8.             myNewStart = input.start.addDay(7);
  9.             input.myDateList.add(myNewStart);
  10.             myNewList = thisapp.date.recursive(myNewStart, input.end, input.myDateList);
  11.         }
  12.         else
  13.         {
  14.             input.myDateList.add(input.end);
  15.         }
  16.     }
  17.     return input.myDateList;
  18. }
RubenZoho Creator Support
Read More

Viewing all articles
Browse latest Browse all 183369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>