Recurring event changes the time on day 11 onwards

More
12 years 1 month ago #41662 by brunopinto
Hello Tuan,

actually the whole problem with this daylightsaving comes from the fact that you add 24h in your code for a day.
This is not always true as when we change time, we loose or win 1h. So a day may have actually 23 or 25 hours.

Here is the fix for your code.
Everywhere where you add 24h do this: $newDate = strtotime('+'.$numberOfDays.' day', $oldDate);

For example in helper.php in the function getWeeklyRecurringEventDates:

//$nextEventDate = $startTime + $weekDay*24*3600 ;
$nextEventDate = strtotime('+'.$weekDay.' day', $startTime);

Of course you'll have to test this, but this is a more "portable" way to add a day to a timestamp.
I am fixing it myself for my purposes. :whistle:
The following user(s) said Thank You: Laszlo Blaho

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41992 by Laszlo Blaho
Hi Bruno!

Can you tell me where can I find this file(s)? Thank you so much!

Blaci

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41993 by brunopinto
/components/com_eventbooking/helper.php
The following user(s) said Thank You: Laszlo Blaho

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41994 by Laszlo Blaho
:-D Hah, It's interersting, I haven't got this file. :-D

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41996 by Laszlo Blaho
I found it here:

/components/com_eventbooking/helper/helper.php

But it doesn't work. :-(

Thanks anyway!

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41997 by Laszlo Blaho
Tuan!

Can you turn off this automatism (Daylight Saving)?

Thanks!

L

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41998 by brunopinto
Be careful to correct the functions you are actually testing.

And of course not correct it blindly. I just mentioned the method to do it, not the exact code for all the functions.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #41999 by Laszlo Blaho
Of course! You are right! Thank you!

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #42000 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Recurring event changes the time on day 11 onwards
Hi All

Please don't change the code. I am trying to spend this weekend to work on it to find the solution. I will get back to you on Monday !

Tuan

Please Log in or Create an account to join the conversation.

More
12 years 3 weeks ago #42441 by mburkart01
Tuan,

I have had great success with the "Fix daylight savings" functionality. I've used it for the last 4 time changes, but when I try to use it now, I get a 500 - An error has occurred, logout path not found. If you are unable to fully fix the daylight savings issue, can you at least fix the "Fix Day light Saving" menu item so that we can apply the temp fix for now.

Thanks,
Mike

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc