|
| 1 | +using Nager.Date.Extensions; |
1 | 2 | using Nager.Date.Models;
|
2 | 3 | using Nager.Date.ReligiousProviders;
|
3 | 4 | using System;
|
@@ -70,13 +71,6 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
|
70 | 71 | HolidayTypes = HolidayTypes.Public
|
71 | 72 | },
|
72 | 73 | new HolidaySpecification
|
73 |
| - { |
74 |
| - Date = new DateTime(year, 9, 1), |
75 |
| - EnglishName = "Day of the Constitution of the Slovak Republic", |
76 |
| - LocalName = "Deň Ústavy Slovenskej republiky", |
77 |
| - HolidayTypes = HolidayTypes.Observance |
78 |
| - }, |
79 |
| - new HolidaySpecification |
80 | 74 | {
|
81 | 75 | Date = new DateTime(year, 9, 15),
|
82 | 76 | EnglishName = "Day of Our Lady of the Seven Sorrows",
|
@@ -122,9 +116,37 @@ protected override IEnumerable<HolidaySpecification> GetHolidaySpecifications(in
|
122 | 116 | this._catholicProvider.EasterMonday("Veľkonočný pondelok", year)
|
123 | 117 | };
|
124 | 118 |
|
| 119 | + holidaySpecifications.AddIfNotNull(this.DayOfTheConstitution(year)); |
| 120 | + |
125 | 121 | return holidaySpecifications;
|
126 | 122 | }
|
127 | 123 |
|
| 124 | + private HolidaySpecification DayOfTheConstitution(int year) |
| 125 | + { |
| 126 | + var englishName = "Day of the Constitution of the Slovak Republic"; |
| 127 | + var localName = "Deň Ústavy Slovenskej republiky"; |
| 128 | + var holidayDate = new DateTime(year, 9, 1); |
| 129 | + |
| 130 | + if (year > 2024) |
| 131 | + { |
| 132 | + return new HolidaySpecification |
| 133 | + { |
| 134 | + Date = holidayDate, |
| 135 | + EnglishName = englishName, |
| 136 | + LocalName = localName, |
| 137 | + HolidayTypes = HolidayTypes.Observance |
| 138 | + }; |
| 139 | + } |
| 140 | + |
| 141 | + return new HolidaySpecification |
| 142 | + { |
| 143 | + Date = holidayDate, |
| 144 | + EnglishName = englishName, |
| 145 | + LocalName = localName, |
| 146 | + HolidayTypes = HolidayTypes.Public |
| 147 | + }; |
| 148 | + } |
| 149 | + |
128 | 150 | /// <inheritdoc/>
|
129 | 151 | public override IEnumerable<string> GetSources()
|
130 | 152 | {
|
|
0 commit comments