/// <summary> /// Get /// </summary> /// <param name="year">The year</param> /// <returns></returns> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.IM; var easterSunday = this._catholicProvider.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var secondFridayInJune = DateSystem.FindDay(year, 6, DayOfWeek.Friday, 2); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(firstMondayInMay, "Labour Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode)); items.Add(new PublicHoliday(secondFridayInJune, "Senior Race Day", "Senior Race Day", countryCode)); items.Add(new PublicHoliday(year, 7, 5, "Tynwald Day", "Tynwald Day", countryCode)); items.Add(new PublicHoliday(lastMondayInAugust, "Late Summer Bank Holiday", "Late Summer Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
/// <summary> /// Get /// </summary> /// <param name="year">The year</param> /// <returns></returns> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.MD; var easterSunday = this._orthodoxProvider.EasterSunday(year); var lastMondayInMay = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 7, "Craciun pe stil Vechi (Orthodox Christmas)", "Craciun pe stil Vechi (Orthodox Christmas)", countryCode)); items.Add(new PublicHoliday(year, 1, 8, "Craciun pe stil Vechi (Orthodox Christmas)", "Craciun pe stil Vechi (Orthodox Christmas)", countryCode)); items.Add(new PublicHoliday(year, 2, 23, "Day of Veterans of the Armed Forces and Law Enforcement Agencies", "Day of Veterans of the Armed Forces and Law Enforcement Agencies", countryCode)); items.Add(new PublicHoliday(year, 3, 8, "International Women's Day", "International Women's Day", countryCode)); items.Add(new PublicHoliday(easterSunday, "Orthodox Easter", "Orthodox Easter", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Memorial Day", "Memorial Day", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Labour Day (Moldova)", "Labour Day (Moldova)", countryCode)); items.Add(new PublicHoliday(year, 5, 9, "Victory and Commemoration Day", "Victory and Commemoration Day", countryCode)); items.Add(new PublicHoliday(year, 5, 22, "Bălţi Day", "Bălţi Day", countryCode)); items.Add(new PublicHoliday(year, 8, 27, "Independence Day (Moldova)", "Independence Day (Moldova)", countryCode)); items.Add(new PublicHoliday(year, 8, 31, "Limba Noastra (National Language Day (Moldova))", "Limba Noastra (National Language Day (Moldova))", countryCode)); items.Add(new PublicHoliday(year, 9, 3, "Day of the Moldovan National Army", "Day of the Moldovan National Army", countryCode)); items.Add(new PublicHoliday(year, 10, 14, "Capital's Day", "Capital's Day", countryCode)); items.Add(new PublicHoliday(year, 11, 21, "South Capital's Day Cahul", "South Capital's Day Cahul", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Craciun pe stil Nou (Western Christmas)", "Craciun pe stil Nou (Western Christmas)", countryCode)); //Not a public holiday //items.Add(new PublicHoliday(year, 3, 1, "Martisor (first day of spring)", "Martisor (first day of spring)", countryCode, null, null, false)); //items.Add(new PublicHoliday(year, 6, 1, "Children's Day", "Children's Day", countryCode, null, null, false)); return(items.OrderBy(o => o.Date)); }
public override IEnumerable <PublicHoliday> Get(int year) { //Ireland //https://en.wikipedia.org/wiki/Public_holidays_in_the_Republic_of_Ireland var countryCode = CountryCode.IE; var easterSunday = base.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var firstMondayInJune = DateSystem.FindDay(year, 6, DayOfWeek.Monday, 1); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 1); var lastMondayInOctober = DateSystem.FindLastDay(year, 10, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Lá Caille", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 3, 17, "Lá Fhéile Pádraig", "Saint Patrick's Day", countryCode, 1903)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Luan Cásca", "Easter Monday", countryCode)); items.Add(new PublicHoliday(firstMondayInMay, "Lá Bealtaine", "May Day", countryCode, 1994)); items.Add(new PublicHoliday(firstMondayInJune, "Lá Saoire i mí an Mheithimh", "June Holiday", countryCode, 1973)); items.Add(new PublicHoliday(firstMondayInAugust, "Lá Saoire i mí Lúnasa", "August Holiday", countryCode)); items.Add(new PublicHoliday(lastMondayInOctober, "Lá Saoire i mí Dheireadh Fómhair", "October Holiday", countryCode, 1977)); items.Add(new PublicHoliday(year, 12, 25, "Lá Nollag", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Lá Fhéile Stiofáin", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
public override IEnumerable <PublicHoliday> Get(int year) { //Isle of Man //https://en.wikipedia.org/wiki/Public_holidays_in_the_Isle_of_Man var countryCode = CountryCode.IM; var easterSunday = base.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var secondFridayInJune = DateSystem.FindDay(year, 6, DayOfWeek.Friday, 2); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(firstMondayInMay, "Labour Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode)); items.Add(new PublicHoliday(secondFridayInJune, "Senior Race Day", "Senior Race Day", countryCode)); items.Add(new PublicHoliday(year, 7, 5, "Tynwald Day", "Tynwald Day", countryCode)); items.Add(new PublicHoliday(lastMondayInAugust, "Late Summer Bank Holiday", "Late Summer Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.GI; var secondMondayInMarch = DateSystem.FindDay(year, Month.March, DayOfWeek.Monday, Occurrence.Second); var lastMondayInMay = DateSystem.FindLastDay(year, Month.May, DayOfWeek.Monday); var thirdMondayInJune = DateSystem.FindDay(year, Month.June, DayOfWeek.Monday, Occurrence.Second); var lastMondayInAugust = DateSystem.FindLastDay(year, Month.August, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(secondMondayInMarch, "Commonwealth Day", "Commonwealth Day", countryCode)); items.Add(this._catholicProvider.GoodFriday("Good Friday", year, countryCode)); items.Add(this._catholicProvider.EasterMonday("Easter Monday", year, countryCode)); items.Add(new PublicHoliday(year, 4, 28, "Workers' Memorial Day", "Workers' Memorial Day", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "May Day Bank Holiday", "May Day Bank Holiday", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode)); items.Add(new PublicHoliday(thirdMondayInJune, "Queen's Birthday", "Queen's Birthday", countryCode)); items.Add(new PublicHoliday(lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 9, 10, "Gibraltar National Day", "Gibraltar National Day", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
public override IEnumerable <PublicHoliday> Get(int year) { //Jersey //https://en.wikipedia.org/wiki/Public_holidays_in_Jersey var countryCode = CountryCode.JE; var easterSunday = base.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(firstMondayInMay, "Early May Bank Holiday", "Early May Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 5, 9, "Liberation Day", "Liberation Day", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode)); items.Add(new PublicHoliday(lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.PR; var secondMondayInJanuary = DateSystem.FindDay(year, Month.January, DayOfWeek.Monday, Occurrence.Second); var thirdMondayInJanuary = DateSystem.FindDay(year, Month.January, DayOfWeek.Monday, Occurrence.Third); var thirdMondayInFebruary = DateSystem.FindDay(year, Month.February, DayOfWeek.Monday, Occurrence.Third); var thirdMondayInApril = DateSystem.FindDay(year, Month.April, DayOfWeek.Monday, Occurrence.Third); var lastMondayInMay = DateSystem.FindLastDay(year, Month.May, DayOfWeek.Monday); var thirdMondayInJuly = DateSystem.FindDay(year, Month.July, DayOfWeek.Monday, Occurrence.Third); var firstMondayInSeptember = DateSystem.FindDay(year, Month.September, DayOfWeek.Monday, Occurrence.First); var secondMondayInOctober = DateSystem.FindDay(year, Month.October, DayOfWeek.Monday, Occurrence.Second); var fourthThursdayInNovember = DateSystem.FindDay(year, Month.November, DayOfWeek.Thursday, Occurrence.Fourth); var items = new List <PublicHoliday>(); #region New Years Day with fallback var newYearsDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearsDay, "Día de Año Nuevo", "New Year's Day", countryCode)); #endregion items.Add(new PublicHoliday(year, 1, 6, "Día de Reyes", "Three Kings Day / Epiphany", countryCode)); items.Add(new PublicHoliday(secondMondayInJanuary, "Natalicio de Eugenio María de Hostos", "Birthday of Eugenio María de Hostos", countryCode)); items.Add(new PublicHoliday(thirdMondayInJanuary, "Natalicio de Martin Luther King, Jr.", "Martin Luther King, Jr. Day", countryCode)); items.Add(new PublicHoliday(thirdMondayInFebruary, "Día de los Presidentes", "Presidents' Day", countryCode)); items.Add(new PublicHoliday(year, 2, 18, "Natalicio de Luis Muñoz Marín", "Birthday of Luis Muñoz Marín", countryCode)); items.Add(new PublicHoliday(year, 3, 22, "Día de la Abolición de Esclavitud", "Emancipation Day", countryCode)); items.Add(this._catholicProvider.GoodFriday("Viernes Santo", year, countryCode)); items.Add(new PublicHoliday(thirdMondayInApril, "Natalicio de José de Diego", "Birthday of José de Diego", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Recordación de los Muertos de la Guerra", "Memorial Day", countryCode)); #region Independence Day with fallback var independenceDay = new DateTime(year, 7, 4).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(independenceDay, "Día de la Independencia de los Estados Unidos", "Independence Day", countryCode)); #endregion items.Add(new PublicHoliday(thirdMondayInJuly, "Natalicio de Don Luis Muñoz Rivera", "Birthday of Don Luis Muñoz Rivera", countryCode)); items.Add(new PublicHoliday(year, 7, 25, "Constitución de Puerto Rico", "Puerto Rico Constitution Day", countryCode)); items.Add(new PublicHoliday(year, 7, 27, "Natalicio de Dr. José Celso Barbosa", "Birthday of Dr. José Celso Barbosa", countryCode)); items.Add(new PublicHoliday(firstMondayInSeptember, "Día del Trabajo", "Labour Day", countryCode)); items.Add(new PublicHoliday(secondMondayInOctober, "Día de la Raza Descubrimiento de América", "Columbus Day", countryCode)); #region Veterans Day with fallback var veteransDay = new DateTime(year, 11, 11).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(veteransDay, "Día del Veterano Día del Armisticio", "Veterans Day", countryCode)); #endregion items.Add(new PublicHoliday(year, 11, 19, "Día del Descubrimiento de Puerto Rico", "Discovery of Puerto Rico", countryCode)); items.Add(new PublicHoliday(fourthThursdayInNovember, "Día de Acción de Gracias", "Thanksgiving Day", countryCode)); items.Add(new PublicHoliday(year, 12, 24, "Noche Buena", "Christmas Eve", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Navidad", "Christmas Day", countryCode)); return(items.OrderBy(o => o.Date)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.IE; var easterSunday = this._catholicProvider.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, Month.May, DayOfWeek.Monday, Occurrence.First); var firstMondayInJune = DateSystem.FindDay(year, Month.June, DayOfWeek.Monday, Occurrence.First); var firstMondayInAugust = DateSystem.FindDay(year, Month.August, DayOfWeek.Monday, Occurrence.First); var lastMondayInOctober = DateSystem.FindLastDay(year, Month.October, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Lá Caille", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 3, 17, "Lá Fhéile Pádraig", "Saint Patrick's Day", countryCode, 1903)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Aoine an Chéasta", "Good Friday", countryCode, type: PublicHolidayType.Bank | PublicHolidayType.School)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Luan Cásca", "Easter Monday", countryCode)); items.Add(new PublicHoliday(firstMondayInMay, "Lá Bealtaine", "May Day", countryCode, 1994)); items.Add(new PublicHoliday(firstMondayInJune, "Lá Saoire i mí an Mheithimh", "June Holiday", countryCode, 1973)); items.Add(new PublicHoliday(firstMondayInAugust, "Lá Saoire i mí Lúnasa", "August Holiday", countryCode)); items.Add(new PublicHoliday(lastMondayInOctober, "Lá Saoire i mí Dheireadh Fómhair", "October Holiday", countryCode, 1977)); items.Add(new PublicHoliday(year, 12, 25, "Lá Nollag", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Lá Fhéile Stiofáin", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.IM; var items = new List <PublicHoliday>(); #region New Year's Day with fallback var newYearDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode)); #endregion var earlyMayBankHoliday = this.GetEarlyMayBankHoliday(year, countryCode); if (earlyMayBankHoliday != null) { items.Add(earlyMayBankHoliday); } items.Add(this._catholicProvider.GoodFriday("Good Friday", year, countryCode)); items.Add(this._catholicProvider.EasterMonday("Easter Monday", year, countryCode)); var springBankHoliday = this.GetSpringBankHoliday(year, countryCode); if (springBankHoliday != null) { items.Add(springBankHoliday); } var queensPlatinumJubilee = this.GetQueensPlatinumJubilee(year, countryCode); if (queensPlatinumJubilee != null) { items.Add(queensPlatinumJubilee); } var ttRaceDay = this.GetTTRaceDay(year, countryCode); if (ttRaceDay != null) { items.Add(ttRaceDay); } var tynwaldDay = new DateTime(year, 7, 5).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(tynwaldDay, "Tynwald Day", "Tynwald Day", countryCode)); var lastMondayInAugust = DateSystem.FindLastDay(year, Month.August, DayOfWeek.Monday); items.Add(new PublicHoliday(lastMondayInAugust, "Late Summer Bank Holiday", "Late Summer Bank Holiday", countryCode)); var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); var stStephensDay = new DateTime(year, 12, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(stStephensDay, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
private PublicHoliday GetSpringBankHoliday(int year, CountryCode countryCode) { var name = "Spring Bank Holiday"; if (year == 2022) { //https://www.gov.uk/government/news/extra-bank-holiday-to-mark-the-queens-platinum-jubilee-in-2022 return(new PublicHoliday(year, 6, 2, name, name, countryCode)); } var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); return(new PublicHoliday(lastMondayInMay, name, name, countryCode, 1971)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.GG; var lastMondayInMay = DateSystem.FindLastDay(year, Month.May, DayOfWeek.Monday); var lastMondayInAugust = DateSystem.FindLastDay(year, Month.August, DayOfWeek.Monday); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(this._catholicProvider.GoodFriday("Good Friday", year, countryCode)); items.Add(this._catholicProvider.EasterMonday("Easter Monday", year, countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Early May Bank Holiday", "Early May Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 5, 9, "Liberation Day", "Liberation Day", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode)); items.Add(new PublicHoliday(lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "Boxing Day", "St. Stephen's Day", countryCode)); return(items.OrderBy(o => o.Date)); }
/// <summary> /// Get /// </summary> /// <param name="year">The year</param> /// <returns></returns> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.US; var thirdMondayInJannuar = DateSystem.FindDay(year, 1, DayOfWeek.Monday, 3); var thirdMondayInFebruary = DateSystem.FindDay(year, 2, DayOfWeek.Monday, 3); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var firstMondayInSeptember = DateSystem.FindDay(year, 9, DayOfWeek.Monday, 1); var secondMondayInOctober = DateSystem.FindDay(year, 10, DayOfWeek.Monday, 2); var fourthThursdayInNovember = DateSystem.FindDay(year, 11, DayOfWeek.Thursday, 4); var items = new List <PublicHoliday>(); #region New Years Day with fallback var newYearsDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearsDay, "New Year's Day", "New Year's Day", countryCode)); #endregion items.Add(new PublicHoliday(thirdMondayInJannuar, "Martin Luther King, Jr. Day", "Martin Luther King, Jr. Day", countryCode)); items.Add(new PublicHoliday(thirdMondayInFebruary, "Washington's Birthday", "Presidents' Day", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Memorial Day", "Memorial Day", countryCode)); #region Independence Day with fallback var independenceDay = new DateTime(year, 7, 4).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(independenceDay, "Independence Day", "Independence Day", countryCode)); #endregion items.Add(new PublicHoliday(firstMondayInSeptember, "Labor Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(secondMondayInOctober, "Columbus Day", "Columbus Day", countryCode, null, new string[] { "US-AL", "US-AZ", "US-CO", "US-CT", "US-DC", "US-GA", "US-ID", "US-IL", "US-IN", "US-IA", "US-KS", "US-KY", "US-LA", "US-ME", "US-MD", "US-MA", "US-MS", "US-MO", "US-MT", "US-NE", "US-NH", "US-NJ", "US-NM", "US-NY", "US-NC", "US-OH", "US-OK", "US-PA", "US-RI", "US-SC", "US-TN", "US-UT", "US-VA", "US-WV" })); #region Veterans Day with fallback var veteransDay = new DateTime(year, 11, 11).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(veteransDay, "Veterans Day", "Veterans Day", countryCode)); #endregion items.Add(new PublicHoliday(fourthThursdayInNovember, "Thanksgiving Day", "Thanksgiving Day", countryCode, 1863)); #region Christmas Day with fallback var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); #endregion #region Inauguration Day (every 4 years) if ((year - 1) % 4 == 0) { if (year >= 1937) { items.Add(new PublicHoliday(year, 1, 20, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } else { items.Add(new PublicHoliday(year, 3, 4, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } } #endregion return(items.OrderBy(o => o.Date)); }
public override IEnumerable <PublicHoliday> Get(int year) { // Puerto Rico // https://en.wikipedia.org/wiki/Public_holidays_in_Puerto_Rico // https://www.timeanddate.com/holidays/puerto-rico/2017#!hol=9 // http://www.puertorico.com/official-holidays/ // http://www.topuertorico.org/reference/holi.shtml var countryCode = CountryCode.PR; var secondMondayInJanuary = DateSystem.FindDay(year, 1, DayOfWeek.Monday, 2); var thirdMondayInJanuary = DateSystem.FindDay(year, 1, DayOfWeek.Monday, 3); var thirdMondayInFebruary = DateSystem.FindDay(year, 2, DayOfWeek.Monday, 3); var easterSunday = EasterSunday(year); var thirdMondayInApril = DateSystem.FindDay(year, 4, DayOfWeek.Monday, 3); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var thirdMondayInJuly = DateSystem.FindDay(year, 7, DayOfWeek.Monday, 3); var firstMondayInSeptember = DateSystem.FindDay(year, 9, DayOfWeek.Monday, 1); var secondMondayInOctober = DateSystem.FindDay(year, 10, DayOfWeek.Monday, 2); var fourthThursdayInNovember = DateSystem.FindDay(year, 11, DayOfWeek.Thursday, 4); var items = new List <PublicHoliday>(); #region New Years Day with fallback var newYearsDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearsDay, "Día de Año Nuevo", "New Year's Day", countryCode)); #endregion items.Add(new PublicHoliday(year, 1, 6, "Día de Reyes", "Three Kings Day / Epiphany", countryCode)); items.Add(new PublicHoliday(secondMondayInJanuary, "Natalicio de Eugenio María de Hostos", "Birthday of Eugenio María de Hostos", countryCode)); items.Add(new PublicHoliday(thirdMondayInJanuary, "Natalicio de Martin Luther King, Jr.", "Martin Luther King, Jr. Day", countryCode)); items.Add(new PublicHoliday(thirdMondayInFebruary, "Día de los Presidentes", "Presidents' Day", countryCode)); items.Add(new PublicHoliday(year, 2, 18, "Natalicio de Luis Muñoz Marín", "Birthday of Luis Muñoz Marín", countryCode)); items.Add(new PublicHoliday(year, 3, 22, "Día de la Abolición de Esclavitud", "Emancipation Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Viernes Santo", "Good Friday", countryCode)); items.Add(new PublicHoliday(thirdMondayInApril, "Natalicio de José de Diego", "Birthday of José de Diego", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Recordación de los Muertos de la Guerra", "Memorial Day", countryCode)); #region Independence Day with fallback var independenceDay = new DateTime(year, 7, 4).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(independenceDay, "Día de la Independencia de los Estados Unidos", "Independence Day", countryCode)); #endregion items.Add(new PublicHoliday(thirdMondayInJuly, "Natalicio de Don Luis Muñoz Rivera", "Birthday of Don Luis Muñoz Rivera", countryCode)); items.Add(new PublicHoliday(year, 7, 25, "Constitución de Puerto Rico", "Puerto Rico Constitution Day", countryCode)); items.Add(new PublicHoliday(year, 7, 27, "Natalicio de Dr. José Celso Barbosa", "Birthday of Dr. José Celso Barbosa", countryCode)); items.Add(new PublicHoliday(firstMondayInSeptember, "Día del Trabajo", "Labour Day", countryCode)); items.Add(new PublicHoliday(secondMondayInOctober, "Día de la Raza Descubrimiento de América", "Columbus Day", countryCode)); #region Veterans Day with fallback var veteransDay = new DateTime(year, 11, 11).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(veteransDay, "Día del Veterano Día del Armisticio", "Veterans Day", countryCode)); #endregion items.Add(new PublicHoliday(year, 11, 19, "Día del Descubrimiento de Puerto Rico", "Discovery of Puerto Rico", countryCode)); items.Add(new PublicHoliday(fourthThursdayInNovember, "Día de Acción de Gracias", "Thanksgiving Day", countryCode)); items.Add(new PublicHoliday(year, 12, 24, "Noche Buena", "Christmas Eve", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Navidad", "Christmas Day", countryCode)); return(items.OrderBy(o => o.Date)); }
public override IEnumerable <PublicHoliday> Get(int year) { //United Kingdom //https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom //https://de.wikipedia.org/wiki/Feiertage_im_Vereinigten_K%C3%B6nigreich var countryCode = CountryCode.GB; var easterSunday = base.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 1); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); #region New Year's Day with fallback var newYearDay = new DateTime(year, 1, 1); if (newYearDay.IsWeekend(countryCode)) { var newYearDayMonday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Monday); var newYearDayTuesday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Tuesday); items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(newYearDayMonday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-ENG", "GB-WLS" })); items.Add(new PublicHoliday(newYearDayTuesday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); } else { items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode)); } #endregion #region New Year's Day 2 with fallback var newYearDay2 = new DateTime(year, 1, 2).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearDay2, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); #endregion items.Add(new PublicHoliday(year, 3, 17, "Saint Patrick's Day", "Saint Patrick's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(year, 5, firstMondayInMay, "Early May Bank Holiday", "Early May Bank Holiday", countryCode, 1978)); items.Add(new PublicHoliday(year, 5, lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode, 1971)); items.Add(new PublicHoliday(year, 7, 12, "Battle of the Boyne", "Battle of the Boyne", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(year, 8, firstMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-SCT" })); items.Add(new PublicHoliday(year, 8, lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-ENG", "GB-WLS" })); #region Christmas Day with fallback var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(3), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); #endregion #region St. Stephen's Day with fallback var sanktStehpenDay = new DateTime(year, 12, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(sanktStehpenDay, "Boxing Day", "St. Stephen's Day", countryCode)); #endregion return(items.OrderBy(o => o.Date)); }
public IEnumerable <PublicHoliday> Get(int year) { //United States of America //https://en.wikipedia.org/wiki/Federal_holidays_in_the_United_States var countryCode = CountryCode.US; var thirdMondayInJannuar = DateSystem.FindDay(year, 1, DayOfWeek.Monday, 3); var thirdMondayInFebruary = DateSystem.FindDay(year, 2, DayOfWeek.Monday, 3); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var firstMondayInSeptember = DateSystem.FindDay(year, 9, DayOfWeek.Monday, 1); var secondMondayInOctober = DateSystem.FindDay(year, 10, DayOfWeek.Monday, 2); var fourthThursdayInNovember = DateSystem.FindDay(year, 11, DayOfWeek.Thursday, 4); var items = new List <PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, thirdMondayInJannuar, "Martin Luther King, Jr. Day", "Martin Luther King, Jr. Day", countryCode)); items.Add(new PublicHoliday(year, 2, thirdMondayInFebruary, "Washington's Birthday", "Presidents' Day", countryCode)); items.Add(new PublicHoliday(year, 5, lastMondayInMay, "Memorial Day", "Memorial Day", countryCode)); items.Add(new PublicHoliday(year, 7, 4, "Independence Day", "Independence Day", countryCode)); items.Add(new PublicHoliday(year, 9, firstMondayInSeptember, "Labor Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(year, 9, secondMondayInOctober, "Columbus Day", "Columbus Day", countryCode, null, new string[] { "US-AL", "US-AZ", "US-CO", "US-CT", "US-DC", "US-GA", "US-ID", "US-IL", "US-IN", "US-IA", "US-KS", "US-KY", "US-LA", "US-ME", "US-MD", "US-MA", "US-MS", "US-MO", "US-MT", "US-NE", "US-NH", "US-NJ", "US-NM", "US-NY", "US-NC", "US-OH", "US-OK", "US-PA", "US-RI", "US-SC", "US-TN", "US-UT", "US-VA", "US-WV" })); items.Add(new PublicHoliday(year, 12, fourthThursdayInNovember, "Thanksgiving Day", "Thanksgiving Day", countryCode, 1863)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); #region Veterans Day var veteransDay = new DateTime(year, 11, 11); if (veteransDay.IsWeekend(CountryCode.US)) { if (veteransDay.DayOfWeek == DayOfWeek.Saturday) { items.Add(new PublicHoliday(veteransDay.AddDays(-1), "Veterans Day", "Veterans Day", countryCode)); } else { items.Add(new PublicHoliday(veteransDay.AddDays(1), "Veterans Day", "Veterans Day", countryCode)); } } else { items.Add(new PublicHoliday(year, 11, 11, "Veterans Day", "Veterans Day", countryCode)); } #endregion #region Inauguration Day (every 4 years) if ((year - 1) % 4 == 0) { if (year >= 1937) { items.Add(new PublicHoliday(year, 1, 20, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } else { items.Add(new PublicHoliday(year, 3, 4, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } } #endregion return(items.OrderBy(o => o.Date)); }
///<inheritdoc/> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.US; var thirdMondayInJanuar = DateSystem.FindDay(year, Month.January, DayOfWeek.Monday, Occurrence.Third); var thirdMondayInFebruary = DateSystem.FindDay(year, Month.February, DayOfWeek.Monday, Occurrence.Third); var lastMondayInMay = DateSystem.FindLastDay(year, Month.May, DayOfWeek.Monday); var firstMondayInSeptember = DateSystem.FindDay(year, Month.September, DayOfWeek.Monday, Occurrence.First); var secondMondayInOctober = DateSystem.FindDay(year, Month.October, DayOfWeek.Monday, Occurrence.Second); var fourthThursdayInNovember = DateSystem.FindDay(year, Month.November, DayOfWeek.Thursday, Occurrence.Fourth); var items = new List <PublicHoliday>(); #region New Years Day with fallback var newYearsDay = new DateTime(year, 1, 1).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearsDay, "New Year's Day", "New Year's Day", countryCode)); #endregion items.Add(new PublicHoliday(thirdMondayInJanuar, "Martin Luther King, Jr. Day", "Martin Luther King, Jr. Day", countryCode)); items.Add(new PublicHoliday(thirdMondayInFebruary, "Presidents Day", "Washington's Birthday", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Memorial Day", "Memorial Day", countryCode)); items.Add(this._catholicProvider.GoodFriday("Good Friday", year, countryCode).SetCounties("US-CT", "US-DE", "US-HI", "US-IN", "US-KY", "US-LA", "US-NC", "US-ND", "US-NJ", "US-TN")); items.Add(this._catholicProvider.GoodFriday("Good Friday", year, countryCode).SetType(PublicHolidayType.Optional).SetCounties("US-TX")); #region Juneteenth if (year >= 2021) { var juneteenth = new DateTime(year, 6, 19).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(juneteenth, "Juneteenth", "Juneteenth", countryCode, 2021)); } #endregion #region Independence Day with fallback var independenceDay = new DateTime(year, 7, 4).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(independenceDay, "Independence Day", "Independence Day", countryCode)); #endregion items.Add(new PublicHoliday(firstMondayInSeptember, "Labor Day", "Labour Day", countryCode)); items.Add(new PublicHoliday(secondMondayInOctober, "Columbus Day", "Columbus Day", countryCode, null, new string[] { "US-AL", "US-AZ", "US-CO", "US-CT", "US-DC", "US-GA", "US-ID", "US-IL", "US-IN", "US-IA", "US-KS", "US-KY", "US-LA", "US-ME", "US-MD", "US-MA", "US-MS", "US-MO", "US-MT", "US-NE", "US-NH", "US-NJ", "US-NM", "US-NY", "US-NC", "US-OH", "US-OK", "US-PA", "US-RI", "US-SC", "US-TN", "US-UT", "US-VA", "US-WV" })); #region Veterans Day with fallback var veteransDay = new DateTime(year, 11, 11).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(veteransDay, "Veterans Day", "Veterans Day", countryCode)); #endregion items.Add(new PublicHoliday(fourthThursdayInNovember, "Thanksgiving Day", "Thanksgiving Day", countryCode, 1863)); #region Christmas Day with fallback var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(-1), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); #endregion #region Inauguration Day (every 4 years) if ((year - 1) % 4 == 0) { if (year >= 1937) { items.Add(new PublicHoliday(year, 1, 20, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } else { items.Add(new PublicHoliday(year, 3, 4, "Inauguration Day", "Inauguration Day", countryCode, null, new string[] { "US-DC", "US-LA", "US-MD", "US-VA" })); } } #endregion return(items.OrderBy(o => o.Date)); }
/// <summary> /// Get /// </summary> /// <param name="year">The year</param> /// <returns></returns> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.GB; var easterSunday = this._catholicProvider.EasterSunday(year); var firstMondayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Monday, 1); var lastMondayInMay = DateSystem.FindLastDay(year, 5, DayOfWeek.Monday); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 1); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); #region New Year's Day with fallback var newYearDay = new DateTime(year, 1, 1); if (newYearDay.IsWeekend(countryCode)) { var newYearDayMonday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Monday); var newYearDayTuesday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Tuesday); items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(newYearDayMonday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-ENG", "GB-WLS" })); items.Add(new PublicHoliday(newYearDayTuesday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); } else { items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode)); } #endregion #region New Year's Day 2 with fallback var newYearDay2 = new DateTime(year, 1, 2).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearDay2, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); #endregion items.Add(new PublicHoliday(year, 3, 17, "Saint Patrick's Day", "Saint Patrick's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode)); items.Add(new PublicHoliday(lastMondayInMay, "Spring Bank Holiday", "Spring Bank Holiday", countryCode, 1971)); items.Add(new PublicHoliday(year, 11, 30, "Saint Andrew's Day", "Saint Andrew's Day", countryCode, null, new string[] { "GB-SCT" })); items.Add(new PublicHoliday(year, 7, 12, "Battle of the Boyne", "Battle of the Boyne", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(firstMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-SCT" })); items.Add(new PublicHoliday(lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-ENG", "GB-WLS" })); #region Early May Bank Holiday var earlyMayBankHoliday = new PublicHoliday(firstMondayInMay, "Early May Bank Holiday", "Early May Bank Holiday", countryCode, 1978); if (year == 2020) { //https://www.bbc.co.uk/news/uk-48565417 var secondFridayInMay = DateSystem.FindDay(year, 5, DayOfWeek.Friday, 2); earlyMayBankHoliday.Date = secondFridayInMay; } items.Add(earlyMayBankHoliday); #endregion #region Christmas Day with fallback var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(3), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); #endregion #region St. Stephen's Day with fallback var sanktStehpenDay = new DateTime(year, 12, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(sanktStehpenDay, "Boxing Day", "St. Stephen's Day", countryCode)); #endregion return(items.OrderBy(o => o.Date)); }
/// <summary> /// Get /// </summary> /// <param name="year">The year</param> /// <returns></returns> public IEnumerable <PublicHoliday> Get(int year) { var countryCode = CountryCode.GB; var easterSunday = this._catholicProvider.EasterSunday(year); var firstMondayInAugust = DateSystem.FindDay(year, 8, DayOfWeek.Monday, 1); var lastMondayInAugust = DateSystem.FindLastDay(year, 8, DayOfWeek.Monday); var items = new List <PublicHoliday>(); #region New Year's Day with fallback var newYearDay = new DateTime(year, 1, 1); if (newYearDay.IsWeekend(countryCode)) { var newYearDayMonday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Monday); var newYearDayTuesday = DateSystem.FindDay(year, 1, 1, DayOfWeek.Tuesday); items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(newYearDayMonday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-ENG", "GB-WLS" })); items.Add(new PublicHoliday(newYearDayTuesday, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); } else { items.Add(new PublicHoliday(newYearDay, "New Year's Day", "New Year's Day", countryCode)); } #endregion #region New Year's Day 2 with fallback var newYearDay2 = new DateTime(year, 1, 2).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(1)); items.Add(new PublicHoliday(newYearDay2, "New Year's Day", "New Year's Day", countryCode, null, new string[] { "GB-SCT" })); #endregion items.Add(new PublicHoliday(year, 3, 17, "Saint Patrick's Day", "Saint Patrick's Day", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Easter Monday", "Easter Monday", countryCode, null, new string[] { "GB-ENG", "GB-WLS", "GB-NIR" })); items.Add(new PublicHoliday(year, 11, 30, "Saint Andrew's Day", "Saint Andrew's Day", countryCode, null, new string[] { "GB-SCT" })); items.Add(new PublicHoliday(year, 7, 12, "Battle of the Boyne", "Battle of the Boyne", countryCode, null, new string[] { "GB-NIR" })); items.Add(new PublicHoliday(firstMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-SCT" })); items.Add(new PublicHoliday(lastMondayInAugust, "Summer Bank Holiday", "Summer Bank Holiday", countryCode, 1971, new string[] { "GB-ENG", "GB-WLS", "GB-NIR" })); var earlyMayBankHoliday = this.GetEarlyMayBankHoliday(year, countryCode); if (earlyMayBankHoliday != null) { items.Add(earlyMayBankHoliday); } var springBankHoliday = this.GetSpringBankHoliday(year, countryCode); if (springBankHoliday != null) { items.Add(springBankHoliday); } var queensPlatinumJubilee = this.GetQueensPlatinumJubilee(year, countryCode); if (queensPlatinumJubilee != null) { items.Add(queensPlatinumJubilee); } #region Christmas Day with fallback var christmasDay = new DateTime(year, 12, 25).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(christmasDay, "Christmas Day", "Christmas Day", countryCode)); #endregion #region St. Stephen's Day with fallback var sanktStehpenDay = new DateTime(year, 12, 26).Shift(saturday => saturday.AddDays(2), sunday => sunday.AddDays(2)); items.Add(new PublicHoliday(sanktStehpenDay, "Boxing Day", "St. Stephen's Day", countryCode)); #endregion return(items.OrderBy(o => o.Date)); }