Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singapore - Fix Chinese New Year sunday shift #571

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Nager.Date/PublicHolidays/SingaporeProvider.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using Nager.Date.Contract;
using Nager.Date.Extensions;
using Nager.Date.Model;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using static System.Collections.Specialized.BitVector32;

namespace Nager.Date.PublicHolidays
{
Expand Down Expand Up @@ -41,8 +39,8 @@ public IEnumerable<PublicHoliday> GetHolidays(int year)
if (year > chineseCalendar.MinSupportedDateTime.Year && year < chineseCalendar.MaxSupportedDateTime.Year)
{
var chineseNewYear = chineseCalendar.ToDateTime(year, 1, 1, 0, 0, 0, 0);
items.Add(new PublicHoliday(chineseNewYear, "Chinese New Year", "Chinese New Year", countryCode));
items.Add(new PublicHoliday(chineseNewYear.AddDays(1), "Chinese New Year", "Chinese New Year", countryCode));
items.Add(new PublicHoliday(chineseNewYear, "Chinese New Year", "Chinese New Year", countryCode).Shift(saturday => saturday, sunday => sunday.AddDays(1)));
items.Add(new PublicHoliday(chineseNewYear.AddDays(1), "Chinese New Year", "Chinese New Year", countryCode).Shift(saturday => saturday, sunday => sunday.AddDays(1)));
}

items.AddIfNotNull(this.HariRayaPuasa(year, countryCode));
Expand Down