/// /// Returns true if we are currently closed for business. /// public bool weAreClosed(string zipCode) { Params.LocationID = FindPostal(zipCode); // To search via coordinates, replace this line with Params.LocationID = FindGps(latitude, longitude); Params.User = APIUSER; Params.Key = APIKEY; Params.Coding = "CS"; Params.Language = "en"; Params.InputDate = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified); try { Day = ZmanimAPI.GetDay(Params); // You may also use: GetDayAsync() } catch (System.ServiceModel.CommunicationException cex) { UnableToConnect(cex.Message); } catch (Exception ex) { SomethingWrong(ex.Message); } if (Day.ErrMsg != null) { Response.Write("Error: " + Day.ErrMsg); return; } // Return true if it is currently Shabbos or Yom Tov. (i.e. if it is before Nightfall on the date of Shabbos/YomTov, or it is within 10 minutes of Sunset on the date of Erev Shabbos/YomTov.) // Check for Shabbos: if (Day.Time.IsErevShabbos & (Day.Zman.CurrentTime > Day.Zman.SunsetDefault.AddMinutes(-10))) return true; if (Day.Time.IsShabbos & (Day.Zman.CurrentTime < Day.Zman.NightShabbos)) return true; // Check for Yom Tov: if (Day.Time.IsErevYomTov & (Day.Zman.CurrentTime > Day.Zman.SunsetDefault.AddMinutes(-10))) return true; if (Day.Time.IsYomTov & (Day.Zman.CurrentTime < Day.Zman.NightShabbos)) return true; }