Replies: 1 comment
-
|
Carbon already has an option for this. But something like this might be useful: $next = Holidays::next('sv'); // Returns ['name' => 'New Year', 'date' => CarbonImmutable object]An extra nullable param for a start date might be usefull too. $next = Holidays::next('sv', startDate: 2024-12-01); // Returns ['name' => 'Christmas', 'date' => CarbonImmutable object]On the Carbon instance you can already count the difference in days. $days = $next['date']->->diffInDays($date); // Returns int |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We could consider implementing a function that allows returning the number of days remaining until the next holiday starting from a date passed to the function and the country.
Example:
Beta Was this translation helpful? Give feedback.
All reactions