public static int[] GetDayOfMonthList(this PersianDateTime value) { int[] dayOfMonths = new[] { value.Day }; if (value.IsLastDayOfCurrentMonth()) { int daysInCurrentMonth = value.GetDaysInCurrentMonth(); if (daysInCurrentMonth == 29) { dayOfMonths = new[] { 29, 30, 31 } } ; else if (daysInCurrentMonth == 30) { dayOfMonths = new[] { 30, 31 } } ; } return(dayOfMonths); }
public static PersianDateTime GetEndOfMonth(this PersianDateTime value) { value.Day = value.GetDaysInCurrentMonth(); return(value); }