private int GetDaysInFirstWeek(int year, JulianCalendarSystem calendar) { // Some of the first few days of the week year may be in the previous week year. // However, the whole of the first week of the week year definitely occurs // within the first 13 days of January. return Enumerable.Range(1, 13) .Count(day => new LocalDate(year, 1, day, calendar).WeekOfWeekYear == 1); }
static JulianCalendarSystem() { instances = new JulianCalendarSystem[7]; for (int i = 0; i < 7; i++) { instances[i] = new JulianCalendarSystem(i + 1); } }