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());
 }
Пример #3
0
 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
 }