SHARE
TWEET

Untitled

a guest Oct 10th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function generateRegexDateRange(start, end)
  3. {
  4.   totalregex = "";
  5.   var diff = parseInt(end.diff(start, 'days'));
  6.   if(diff==0)
  7.   {
  8.     console.log('('+start.format("YYYY-MM-DD")+")");
  9.     return '('+start.format("YYYY-MM-DD")+")";
  10.   }
  11.   var temp = start.clone();
  12.  
  13.   for (let count = 0; count <=diff; count++) {
  14.    
  15.     totalregex = totalregex+"("+temp.format("YYYY-MM-DD")+")|";
  16.     temp.add(1, 'days');
  17.  }
  18.  
  19.  var totalres = totalregex.substring(0, totalregex.length - 1);
  20. return totalres;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top