public static EDaysOfWeekExt ConvertFrom(EDaysOfWeek dayOfWeek) { if (Enum.IsDefined(typeof(EDaysOfWeek), dayOfWeek)) { return((EDaysOfWeekExt)Enum.Parse(typeof(EDaysOfWeekExt), Enum.GetName(typeof(EDaysOfWeek), dayOfWeek))); } else { throw new ArgumentException($"Undefined {typeof(EDaysOfWeek)} value ({(int) dayOfWeek})."); } }
public static bool DateMatches(this DateTime date, EDaysOfWeek dow) { return(ConvertFrom(date.DayOfWeek) == dow); }
public static DateTime GetDate(int year, int month, EWeeksInMonth weekInMonth, EDaysOfWeek dayOfWeek) { return(GetDate(year, Month.GetMonth(month), weekInMonth, DaysOfWeekExt.ConvertFrom(dayOfWeek))); }
public static bool IsWeekendDay(this EDaysOfWeek dayOfWeek) { return(WeekendDays.Contains(dayOfWeek)); }