From de272b4a8ff47fbbb2e45ec282d3964284e3148b Mon Sep 17 00:00:00 2001 From: Joao Matos Silva Date: Sun, 7 Jan 2018 00:20:01 +0000 Subject: [PATCH] Fixing some FR holidays logic. Fixes #82 --- .../CultureStrategies/FR_FRHolidayStrategy.cs | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/DateTimeExtensions/WorkingDays/CultureStrategies/FR_FRHolidayStrategy.cs b/src/DateTimeExtensions/WorkingDays/CultureStrategies/FR_FRHolidayStrategy.cs index e1fb765..02b1789 100644 --- a/src/DateTimeExtensions/WorkingDays/CultureStrategies/FR_FRHolidayStrategy.cs +++ b/src/DateTimeExtensions/WorkingDays/CultureStrategies/FR_FRHolidayStrategy.cs @@ -29,19 +29,29 @@ namespace DateTimeExtensions.WorkingDays.CultureStrategies [Locale("fr-FR")] public class FR_FRHolidayStrategy : HolidayStrategyBase, IHolidayStrategy { - public FR_FRHolidayStrategy() + public FR_FRHolidayStrategy(string region) { this.InnerHolidays.Add(GlobalHolidays.NewYear); this.InnerHolidays.Add(ChristianHolidays.EasterMonday); this.InnerHolidays.Add(ChristianHolidays.Ascension); this.InnerHolidays.Add(ChristianHolidays.AllSaints); this.InnerHolidays.Add(ChristianHolidays.Christmas); + this.InnerHolidays.Add(ChristianHolidays.Assumption); this.InnerHolidays.Add(GlobalHolidays.InternationalWorkersDay); this.InnerHolidays.Add(GlobalHolidays.VeteransDay); this.InnerHolidays.Add(VictoryInEuropeDay); this.InnerHolidays.Add(BastilleDay); - this.InnerHolidays.Add(StEtienne); + + if (string.IsNullOrEmpty(region)) + { + return; + } + + if (region == "Alsace" || region == "Lorraine") + { + this.InnerHolidays.Add(StStephensDay); + } } private static Holiday victoryInEuropeDay; @@ -72,17 +82,17 @@ public static Holiday BastilleDay } } - private static Holiday stEtienne; + private static Holiday stStephensDay; - public static Holiday StEtienne + public static Holiday StStephensDay { get { - if (stEtienne == null) + if (stStephensDay == null) { - stEtienne = new FixedHoliday("St Etienne", 12, 26); + stStephensDay = new FixedHoliday("St Stephen's Day", 12, 26); } - return stEtienne; + return stStephensDay; } } }