In the method below, the specified date is the last date of the week of the month.
private bool IsLastOfMonth(DateTime date) { var oneWeekAfter = date.AddDays(7); return oneWeekAfter.Month != date.Month; }
So there is a new method, it just checks Mondays
private bool IsLastMonday(DateTime date) { if (date.DayOfWeek != DayOfWeek.Monday) return false; // it is not monday // the next monday is... var oneWeekAfter = date.AddDays(7); // and is it in same month?, if it is, that means its not last monday return oneWeekAfter.Month != date.Month; }
source share