public int DaysUntilStartOfMonth(int currentMonth, int currentYear)
{
if (currentMonth == 1) return 0;
int retValue = 31;
if (currentMonth >= 3)
{
retValue += 28;
if (GetIsLeapYear(currentYear)) retValue++;
}
else if (currentMonth >= 4) retValue += 31;
else if (currentMonth >= 5) retValue += 30;
else if (currentMonth >= 6) retValue += 31;
else if (currentMonth >= 7) retValue += 30;
else if (currentMonth >= 8) retValue += 31;
else if (currentMonth >= 9) retValue += 31;
else if (currentMonth >= 10) retValue += 30;
else if (currentMonth >= 11) retValue += 31;
else if (currentMonth >= 12) retValue += 30;
return retValue;
}