title: Make Calendar as 2D Array
body: <p>I am trying to make a calendar as a HTML table. It should be a single 2D array with each row as a week and each column as a day. The Week start needs to be a Monday and there must be blank spaces for overlapping months.</p>
  
  <p>The Issue is the Start Days are wrong for every month and differently wrong each time. January 1st 2019 was a Tuesday so i expect the Start Day to be a 2, however i get 4 (a Thursday), the same issue is for every other month.</p>
  
  <p>I am using functions to get the amount of days in the month and the day the month starts on</p>
  
  <pre><code>function month_days(month, year) {return new Date(year, month, 0).getDate();}
  function month_start(month, year) {return new Date(year, month, 0).getDay();}
  </code></pre>
  
  <p>My problem is with the month_start function.</p>
  
  <pre><code>//date is an date object generated on the fly using date.setMonth() and date.setYear();
  var month_2D_arr = gen_days(date.getMonth()+1, date.getFullYear());
  
  function gen_days(month, year){
    var monthNames = ["January", "February", "March", "April", "May", "June",  "July", "August", "September", "October", "November", "December"];
    var checking = new Date(year, month, 0);
    console.log(monthNames[checking.getMonth()]);
    console.log(checking.getFullYear());
  
    var days = mondays(month, year);
    var start = monstart(month, year);
    console.log("start="+start);
  }
  </code></pre>
  
  <p>The outputs are as follows (I induced the actual day names manually) compared to what the are suppose to be (to the right of "||").</p>
  
  <pre><code>    My Results            ||       Actual Days
  January = 4 - Thursday    ||   January = 2 - Tuesday
  February = 4 - Thursday   ||   February = 5 - Friday
  March = 0 - Sunday        ||   March = 5 - Friday
  April = 2 - Tuesday       ||   April = 1 -Monday
  May = 5 - Friday          ||   May = 3 - Wednesday
  June = 0 - Sunday         ||   June = 6 - Saturday
  July = 3 - Wednesday      ||   July = 1 - Monday
  August = 6 - Saturday     ||   August = 4 - Thursday
  September = 1 - Monday    ||   September = 0 - Sunday
  October = 4 - Thursday    ||   October = 2 - Tuesday
  November = 6 - Saturday   ||   November = 5 - Friday
  December = 2 - Tuesday    ||   December = 0 - Sunday
  
  Example console log:
  December //(month)
  2019     //(year)
  start=2  //(start day)
  </code></pre>
  
  <p>I have also switched set/getFullYear() to set/getYear() accounting for the 1900 difference and checking still. There is no difference to it.</p>