Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Recurrences dates are not right #11

Open
buddy94 opened this issue Mar 15, 2023 · 0 comments
Open

[Bug] Recurrences dates are not right #11

buddy94 opened this issue Mar 15, 2023 · 0 comments

Comments

@buddy94
Copy link

buddy94 commented Mar 15, 2023

I found that if I create an event with:

[
'recurring_type' => RecurringFrequencyType::RECURRING_TYPE_DAILY,
     'repeat_interval' => 15, 
     'repeat_by_days' => [], 
     'repeat_by_months' => [],
    'max_occurrences' => null, 
]

When i call the function getEventsBetween the dates of the recurrences of the event are wrong.

From what I understood the function $this->getNextEvents($numberOfEvents); generate the recurrences starting from the original event date.
The problem is that in the function getEventsBetween, before calling getNextEvents() the starting date is changed with the starting date of the period that the user need:

if ($startDate > $this->start_date) {
            $this->start_date = Carbon::parse($startDate);
        }

Then when calling getNextEvents() all the events date are wrong.

If I delete this line:

if ($startDate > $this->start_date) {
            $this->start_date = Carbon::parse($startDate);
        }

everything works fine, but then I have performances issues.

Thanks in advance

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

No branches or pull requests

1 participant