title: Calculate the Number of Mondays in a Month
body: <p>I want to calculate the number of weeks within a month.</p>
  
  <p>The first week of January 2014 starting from the first Monday is the 6th. So, January has 4 weeks. 
  The first week of March 2014 starting from the first Monday is the 3rd. So, March has 5 weeks.</p>
  
  <p>I want to know how many weeks there are in a month counting from the first Monday, not the first day.</p>
  
  <p>How do I do this?</p>
  
  <p>I have this code but it is used to get week number of the month for specific dates.</p>
  
  <pre><code>public int GetWeekNumberOfMonth(DateTime date)
  {
      date = date.Date;
      DateTime firstMonthDay = new DateTime(date.Year, date.Month, 1);
      DateTime firstMonthMonday = firstMonthDay.AddDays((DayOfWeek.Monday + 7 - firstMonthDay.DayOfWeek) % 7);
      if (firstMonthMonday &gt; date)
      {
          firstMonthDay = firstMonthDay.AddMonths(-1);
          firstMonthMonday = firstMonthDay.AddDays((DayOfWeek.Monday + 7 - firstMonthDay.DayOfWeek) % 7);
      }
      return (date - firstMonthMonday).Days / 7 + 1;
  }
  </code></pre>