mohammedmanssour / laravel-recurring-models

The ultimate solution for adding recurring functionality to your Laravel Models!
MIT License
249 stars 20 forks source link

[Bug]: everyNDays(days: 5) doesn't work #12

Closed lorderetik closed 6 months ago

lorderetik commented 8 months ago

What happened?

Create event for date 2024-02-19 15:30 every 5 days. whereOccurresOn(Carbon::make('2024-02-29'))->get(); returns empty, but it should repeat event in this date

How to reproduce the bug

Create event for date 2024-02-19 15:30 every 5 days.

Package Version

0.5.1

PHP Version

8.2

Laravel Version

10.43

Which operating systems does with happen with?

Linux

Notes

Also it doesn't work for events that have duration more than one day, for example, start date 2024-02-19 15:30, end date 2024-02-22 17:30

rappasoft commented 8 months ago

Also having this issue.

EriBloo commented 7 months ago

Hi, This is not due to everyNDays(days: 5) or 2024-02-29 being leep day, but because you also provide the time (basically this would work, if you did whereOccurresOn(Carbon::make('2024-02-29 15:30'))->get();). This should be fixed if this PR is merged.