public void Will_return_null_when_trying_to_get_the_zman() { var calendar = new ComplexZmanimCalendar( new DateTime(2010, 5, 27), new GeoLocation("Gateshead, England", 54.9593729, -1.6018252, 0, new WindowsTimeZone(TimeZoneInfo.Utc)) ); Assert.That(calendar.GetAlos16Point1Degrees(), Is.Null); }
public IEnumerable<ComplexZmanimCalendar> GetDaysInHebrewMonth(DateTime yearAndMonth, GeoLocation location) { Calendar calendar = new HebrewCalendar(); var daysInMonth = calendar.GetDaysInMonth(calendar.GetYear(yearAndMonth), calendar.GetMonth(yearAndMonth)); for (int i = 0; i < daysInMonth; i++) { var zmanimCalendar = new ComplexZmanimCalendar(location); zmanimCalendar.DateWithLocation.Date = new DateTime(yearAndMonth.Year, yearAndMonth.Month, i + 1); yield return zmanimCalendar; } }
public void Check_is_offset_timezone_working() { String locationName = "Lakewood, NJ"; double latitude = 40.09596; //Lakewood, NJ double longitude = -74.22213; //Lakewood, NJ double elevation = 0; //optional elevation var timeZone = new OffsetTimeZone(new TimeSpan(0, 0, -14400)); var location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); var czc = new ComplexZmanimCalendar(new DateTime(2010, 4, 2), location); var zman = czc.GetSunrise(); Assert.That(zman, Is.EqualTo( new DateTime(2010, 4, 2, 6, 39, 41, 832) )); }
public IEnumerable<ComplexZmanimCalendar> GetDaysInHebrewYear(DateTime year, GeoLocation location) { Calendar calendar = new HebrewCalendar(); var currentYear = calendar.GetYear(year); var amountOfMonths = calendar.GetMonthsInYear(currentYear); for (int i = 0; i < amountOfMonths; i++) { var currentMonth = i + 1; var daysInMonth = calendar.GetDaysInMonth(currentYear, currentMonth); for (int dayOfMonth = 0; dayOfMonth < daysInMonth; dayOfMonth++) { var zmanimCalendar = new ComplexZmanimCalendar(location); zmanimCalendar.DateWithLocation.Date = new DateTime(currentYear, currentMonth, dayOfMonth + 1, calendar); yield return zmanimCalendar; } } }
public ComplexZmanimCalendar GetCalendar() { String locationName = "Lakewood, NJ"; double latitude = 40.09596; //Lakewood, NJ double longitude = -74.22213; //Lakewood, NJ double elevation = 0; //optional elevation ITimeZone timeZone = new OlsonTimeZone("America/New_York"); GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); ComplexZmanimCalendar czc = new ComplexZmanimCalendar(new DateTime(2010, 4, 2), location); /* string locationName = "Brooklyn, NY"; double latitude = 40.618851; //Brooklyn, NY double longitude = -73.985921; //Brooklyn, NY double elevation = 0; //optional elevation TimeZone timeZone = TimeZone.getTimeZone("America/New_York"); var location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); var czc = new ComplexZmanimCalendar(location); czc.setCalendar(new GregorianCalendar(2010, 3, 2)); */ return czc; }
public void Setup() { String locationName = "Lakewood, NJ"; double latitude = 40.09596; //Lakewood, NJ double longitude = -74.22213; //Lakewood, NJ double elevation = 0; //optional elevation ITimeZone timeZone = new OlsonTimeZone("America/New_York"); GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); ComplexZmanimCalendar czc = new ComplexZmanimCalendar(new DateTime(2010, 4, 2), location); calendar = czc; }