-
Notifications
You must be signed in to change notification settings - Fork 5
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
End date becomes one day earlier after saving post. #21
Comments
Hi @krigsstev, This is weird indeed. I just tried setting the timezone locally to Los Angeles and could not reproduce the issue. Could you please update ACF RRule to the latest dev version and tell me if you still get the wrong end date? |
Sorry, it doesn't help. The only thing that works for me is patching to change the setTime to 23 hrs. |
Ok so I figured out how to reproduce your problem and can confirm there is a bug with the Your patch might work for you right now but it is not reliable. It works because if you consider that April 17 is in the UTC timezone and you convert it to Los Angeles, you remove 7 hours so that makes the new datetime to April 16 17:00. If you set the end time to April 17 23:00 and you remove 7 hours the new datetime becomes April 16 16:00. So it won't work for eastern timezones. I'll investigate a bit more today to find a solution. |
@krigsstev I think I found a workaround for now. It turns out that there are It looks like the |
@marcbelletre Awesome, that fixes it. Thanks for this. |
Not sure why no-one else has run across this, When I set the end date witht the picker to e.g. 2023-04-23, it changes after saving to 2023-04-22. This happens even if the start_date is the same, in which case I end up with the end_date one day earlier than the start date.
The site I'm using this on has timezone set to Los Angeles, but I changed it to UTC and it still malfunctions.
doing some debugging, If I log like this:
I get
end dateTime: 2023-04-23 00:00:00
Until: 2023-04-22 17:00:00
If I change the code above like so:
$end_date->setTime(23, 0, 0);
I get
end dateTime: 2023-04-23 00:00:00
Until: 2023-04-23 15:00:00
So Maybe the problem is in simshaun/recurr, but it could be the problem is the DateTime object that's passed to recurr.
Maybe this doesn't break for people at or east of Greenwich? If you change the time to 23 hrs, will it malfunction for people further east?
The text was updated successfully, but these errors were encountered: