title: create calendar array by moment.js
body: <p>I want to create array like this.</p>
  
  <pre class="lang-js prettyprint-override"><code>var date_ = [
  { "DateText": "Mon - 2nd April", "Date": "2/4/2017", "WeekNumber" : 13 },
  { "DateText": "Tue - 3rd April", "Date": "3/4/2017", "WeekNumber": 14 },
  { "DateText": "Wed - 4th April", "Date": "4/4/2017", "WeekNumber": 14 }
  ];
  </code></pre>
  
  <p>I got everything just this 2nd, 3rd and 4th number convention is remaining, can you check my piece of code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var date_ = []; 
  
  var prevDate = moment().subtract(15, 'days');
  var nextDate = moment().add(15, 'days');
  
  var start = new Date(prevDate);
  var end = new Date(nextDate);
  
  while(start &lt; end){
     date_.push(
        {
          "DateText" : moment(start).format('ddd - DD MMM'),
          "Date" : moment(start).format('DD/MM/YYYY'),
          "WeekNumber" : moment(start).week()
        }
      );
     var newDate = start.setDate(start.getDate() + 1);
     start = new Date(newDate);  
  }
  
  console.log(date_);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks</p>