Fix WeekdayInMonth holiday shouldCelebrate not checking for current month

This commit is contained in:
Vera Aguilera Puerto
2021-02-14 21:47:21 +01:00
parent ab56f7dc92
commit ff68d30a8e

View File

@@ -22,6 +22,10 @@ namespace Content.Server.Holiday.ShouldCelebrate
public override bool ShouldCelebrate(DateTime date, HolidayPrototype holiday)
{
// Not the needed month.
if (date.Month != (int) holiday.BeginMonth)
return false;
// Occurrence NEEDS to be between 1 and 4.
_occurrence = Math.Max(1, Math.Min(_occurrence, 4));