Skip to content

Commit

Permalink
Singapore - Fix Chinese New Year sunday shift (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager authored Dec 13, 2023
1 parent ad9e0b2 commit 88c8ec6
Showing 1 changed file with 2 additions and 4 deletions.
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

0 comments on commit 88c8ec6

Please sign in to comment.