Skip to content

V2: Calendar architecture cleanup#317

Merged
Nielsvanpach merged 1 commit intov2from
feature/calendar-cleanup
Feb 25, 2026
Merged

V2: Calendar architecture cleanup#317
Nielsvanpach merged 1 commit intov2from
feature/calendar-cleanup

Conversation

@Nielsvanpach
Copy link
Copy Markdown
Collaborator

Summary

  • Extract duplicated getSingleDayHoliday, getMultiDayHoliday, createPeriod, and getOverlapping methods from IslamicCalendar and IndianCalendar into a shared ResolvesCalendarDates trait
  • Simplify Observable trait: weekendToNextMonday() and sundayToNextMonday() now accept only CarbonInterface (removed dead string handling and $year parameter)
  • Change calendar lookup constants on Albania, Turkey, and India from public const to protected const
  • Add @mixin Country annotations to ChineseCalendar and NepaliCalendar for PHPStan

Breaking changes

  • Observable::weekendToNextMonday() and sundayToNextMonday() signature changed from (string|CarbonInterface $date, int $year) to (CarbonInterface $date)
  • Calendar lookup constants (eidAlFitr, eidAlAdha, holiHolidays, etc.) changed from public to protected

@Nielsvanpach Nielsvanpach merged commit 76e3898 into v2 Feb 25, 2026
12 checks passed
@Nielsvanpach Nielsvanpach deleted the feature/calendar-cleanup branch February 25, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant