public static int?DayOfWeekend(this LocalDateTime dt, string country) { if (country.IsIsrael()) { if (dt.IsFriday()) { return(1); } if (dt.IsSaturday()) { return(2); } } else { if (dt.IsSaturday()) { return(1); } if (dt.IsSunday()) { return(2); } } return(null); }
public static bool IsWeekend(this LocalDateTime dt, string country) { if (country.IsIsrael()) { return(dt.IsFriday() || dt.IsSaturday()); } return(dt.IsSaturday() || dt.IsSunday()); }
public static int DayOfWeekend(this LocalDateTime dt, string country) { if (country.IsIsrael()) { if (dt.IsFriday()) { return(1); } if (dt.IsSaturday()) { return(2); } return(0); // not a weekend } if (dt.IsSaturday()) { return(1); } if (dt.IsSunday()) { return(2); } return(0); // not a weekend }