Skip to content

Commit

Permalink
Commenting for #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Willey committed Sep 17, 2021
1 parent 4527318 commit 0ff9d37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/PublicHoliday/CanadaPublicHoliday.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace PublicHoliday
/// </description>
/// </summary>
/// <remarks>
/// Federal nation-wide holidays only. Provincal holidays (eg Family Day in Feb) are excluded and are not observed by Federal employees.
/// Federal nation-wide holidays only. Provincial holidays (eg Family Day in Feb) are excluded and are not observed by Federal employees.
/// </remarks>
public class CanadaPublicHoliday : PublicHolidayBase
{
Expand Down
19 changes: 13 additions & 6 deletions src/PublicHoliday/JapanPublicHoliday.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ public static DateTime LabourThanksgivingDay(int year)
/// <returns></returns>
public static DateTime EmperorsBirthday(int year)
{
//December 23
if (year >= 2020)
{
//23 February Emperor Naruhito 徳仁 2020 –
return FixSunday(new DateTime(year, 2, 23));

}
//23 December Emperor Akihito 明仁 1989–2018
return FixSunday(new DateTime(year, 12, 23));
}

Expand All @@ -207,6 +207,7 @@ private static DateTime FixSunday(DateTime hol)
hol = hol.AddDays(1);
return hol;
}

#endregion Individual Holidays

/// <summary>
Expand All @@ -231,7 +232,8 @@ public override IDictionary<DateTime, string> PublicHolidayNames(int year)
if (greeneryDay == constitutionMemorialDay) greeneryDay = greeneryDay.AddMilliseconds(1);
var childrensDay = ChildrensDay(year);
if (greeneryDay == childrensDay) childrensDay = childrensDay.AddMilliseconds(1);
var hols = new Dictionary<DateTime, string>

var hols = new SortedDictionary<DateTime, string>
{
{ NewYear(year), "New Year" },
{ ComingOfAgeDay(year), "Coming Of Age Day" },
Expand Down Expand Up @@ -276,18 +278,24 @@ public override bool IsPublicHoliday(DateTime dt)
if (ComingOfAgeDay(year) == date)
return true;
break;

case 2:
if (FoundationDay(year) == date)
return true;
if (year >= 2020 && date == EmperorsBirthday(year))
return true;
break;

case 3:
if (VernalEquinoxDay(year) == date)
return true;
break;

case 4:
if (ShōwaDay(year) == date)
return true;
break;

case 5:
if (ConstitutionMemorialDay(year) == date)
return true;
Expand All @@ -306,14 +314,14 @@ public override bool IsPublicHoliday(DateTime dt)
if (MountainDay(year) == date)
return true;
break;

case 9:
if (RespectForTheAgedDay(year) == date)
return true;
if (AutumnalEquinoxDay(year) == date)
return true;
break;


case 10:
if (HealthAndSportsDay(year) == date)
return true;
Expand All @@ -327,13 +335,12 @@ public override bool IsPublicHoliday(DateTime dt)
break;

case 12:
if (EmperorsBirthday(year) == date)
if (year < 2020 && EmperorsBirthday(year) == date)
return true;
break;
}

return false;
}

}
}
2 changes: 1 addition & 1 deletion src/PublicHoliday/PublicHoliday.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
2.4.0: Scotland, Northern Island holidays (thanks @stuart-lawrence)
2.5.0: US 2021 Juneteenth added
2.6.0: New Zealand Matariki dates added for next 30 years
2.7.0: Add Denmark (thanks @Halling69), add Canada Truth&amp;Reconciliation from 2021 (thanks @mattandwhatnot)</PackageReleaseNotes>
2.7.0: Add Denmark (thanks @Halling69), add Canada Truth&amp;Reconciliation from 2021 (thanks @mattandwhatnot), change Japan Emperors Day (thanks @zimathon)</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/martinjw/Holiday</PackageProjectUrl>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
Expand Down

0 comments on commit 0ff9d37

Please sign in to comment.