Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: TurtleKicker on February 24, 2019, 01:16:26 AM

Title: Bug? All day calendar events shown on previous date
Post by: TurtleKicker on February 24, 2019, 01:16:26 AM
I think I found another bug!

When creating a calendar event, if you set it as an all-day event, on the monthly calendar view the event is show as occurring 1 day earlier than the set date. Events with a specific start-end time display on the correct day.

Can someone else confirm before I file a bug report? I don't see one already in Github
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on February 24, 2019, 03:21:24 AM
What language are you using?
Title: Re: Bug? All day calendar events shown on previous date
Post by: albertlast on February 24, 2019, 04:09:50 AM
Could be related to timezone.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on February 24, 2019, 04:14:24 AM
There was a specific bug I was thinking of with the assignments being off by one... in German I want to say. Wasn't sure if it was only that language or not.
Title: Re: Bug? All day calendar events shown on previous date
Post by: TurtleKicker on February 24, 2019, 08:43:44 PM
Quote from: Arantor on February 24, 2019, 03:21:24 AM
What language are you using?
English. :P

Quote from: albertlast on February 24, 2019, 04:09:50 AM
Could be related to timezone.
I think that was it. I misunderstood the timezone settings, and did the wrong thing to get posts to appear with the correct time. I think I sorted it out, and now posts are the right time and the beforementioned calendar issue is gone.

Thanks for pointing me in the right direction!
Title: Re: Bug? All day calendar events shown on previous date
Post by: landyvlad on February 27, 2019, 11:21:36 PM
I'm having the same issue for full day events.
Can you be more specific about the timezone issues please?
Title: Re: Bug? All day calendar events shown on previous date
Post by: TurtleKicker on February 28, 2019, 12:24:40 AM
Quote from: landyvlad on February 27, 2019, 11:21:36 PM
I'm having the same issue for full day events.
Can you be more specific about the timezone issues please?
The timezone you set in SMF has to be the actual TZ your server is located in. Not what your TZ is.

I had accidentally set it to my own TZ, then set the adjustment amount to correct it, and while things seemed ok after that, the calendar issue arose.

You may have to check with your webhost to find the actual local TZ of your server. Or experiment until it's correct (make sure your TZ for your server profile is set correctly for your own local TZ).
Title: Re: Bug? All day calendar events shown on previous date
Post by: landyvlad on February 28, 2019, 02:09:19 AM
Ah ok thanks


using a fixed hours offset isn't helpful though.

The server is located in a nearby daylight savings zone, where I am not.  So sometimes my local TZ will be the same as the server and sometimes not....
Title: Re: Bug? All day calendar events shown on previous date
Post by: albertlast on February 28, 2019, 02:38:02 AM
Just for my understanding,
What would be expected behaviour when you place a event for a full day let's say 28.2.

When some else got a outset of -1 hour to you?
Should he see the event from 27.2. 23:00 till 28.2. 23:00?
Or from 28.2. 0:00 till 23:59 (please had I'm mind the offset can larger)
Title: Re: Bug? All day calendar events shown on previous date
Post by: Gwenwyfar on February 28, 2019, 09:25:49 AM
Quote from: Arantor on February 24, 2019, 04:14:24 AM
There was a specific bug I was thinking of with the assignments being off by one... in German I want to say. Wasn't sure if it was only that language or not.
What was that? I used to occasionally see events spanning multiple days kept coming short on 1. Then you'd edit it and it would get cut off by 1 again. I had to make 7 day events last 8. But this on 2.0, I have not tested it in 2.1.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on February 28, 2019, 10:42:57 AM
There was a bug recently where in the language pack, all the days were off by one; SMF needs day 0 to be Sunday but in one language pack it was someone Monday.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Gwenwyfar on February 28, 2019, 12:14:03 PM
Ahh.
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on May 09, 2019, 07:03:38 PM
I have the same issue.
All full day events and all holidays are off 1 day.

It seems also that user logon-times are 2 hours behind actual time.
I have checked that both the PHP.info and server settings in SMF say timezone "Europe/Oslo", which should be correct.
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on May 12, 2019, 06:07:18 PM
Update:  changing all users in the database from UTC to the strangely named timezone "Antarctica/Troll CEST", it works ok.
However, that timezone name must be an internal joke that was just left there by mistake?

Quote from: PoML on May 09, 2019, 07:03:38 PM
I have the same issue.
All full day events and all holidays are off 1 day.

It seems also that user logon-times are 2 hours behind actual time.
I have checked that both the PHP.info and server settings in SMF say timezone "Europe/Oslo", which should be correct.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on May 12, 2019, 06:21:51 PM
No joke. It really is called that.

https://en.m.wikipedia.org/wiki/Troll_(research_station) (https://en.m.wikipedia.org/wiki/Troll_(research_station))
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on May 12, 2019, 06:39:24 PM
Yes and no...
Central European Summer Time (CEST) isn't really described best by the Norwegian research station Troll, is it?  But OK, technically it isn't wrong, but it is more common to name the capitals that use this time zone?  See  https://en.m.wikipedia.org/wiki/Central_European_Summer_Time

On a more serious question: When all users have to have a summer- time zone manually set now - what when we return to regular (winter) time? 
Do I as admin need to reset this user setting twice a year unless we want full-day events and holidays to appear on the wrong date 6 months every year?

Dag

Quote from: Arantor on May 12, 2019, 06:21:51 PM
No joke. It really is called that.

https://en.m.wikipedia.org/wiki/Troll_(research_station) (https://en.m.wikipedia.org/wiki/Troll_(research_station))
Title: Re: Bug? All day calendar events shown on previous date
Post by: Northern Ireland on October 27, 2019, 09:42:12 PM
I discovered the same bug in my recently installed smf today. 

posted events are a day off
Title: Re: Bug? All day calendar events shown on previous date
Post by: m4z on October 28, 2019, 02:41:24 AM
Quote from: Northern Ireland on October 27, 2019, 09:42:12 PM
I discovered the same bug in my recently installed smf today. 

posted events are a day off

The OP wrote he/she incorrectly had an offset configured (which is problematic, because it is added to both the forum TZ and the user TZs, if your users have set them (explanation in a different bug report (https://github.com/SimpleMachines/SMF2.1/issues/5833#issuecomment-544529231))). Instead what has to be done is to set the forum TZ to the actual server TZ, and instruct all users to set their personal TZ.

Does this also apply to you, or are you seeing a different bug?

PS: Also see this issue: The calendar events are in UTC (https://github.com/SimpleMachines/SMF2.1/issues/5842); so if your current time is corresponding to sometime "yesterday" in UTC, that might explain why the event is off.
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on October 28, 2019, 01:09:13 PM
Actually, roughly 50% of all-day events will be "yesterday" in a random user/forum timezone...
The system would be more resilient if all-day events were stored with the time noon that day rather than 0 hours :-)
Title: Re: Bug? All day calendar events shown on previous date
Post by: Northern Ireland on October 28, 2019, 08:21:06 PM
Quote from: m4z on October 28, 2019, 02:41:24 AM
Quote from: Northern Ireland on October 27, 2019, 09:42:12 PM
I discovered the same bug in my recently installed smf today. 

posted events are a day off

The OP wrote he/she incorrectly had an offset configured (which is problematic, because it is added to both the forum TZ and the user TZs, if your users have set them (explanation in a different bug report (https://github.com/SimpleMachines/SMF2.1/issues/5833#issuecomment-544529231))). Instead what has to be done is to set the forum TZ to the actual server TZ, and instruct all users to set their personal TZ.

Does this also apply to you, or are you seeing a different bug?

PS: Also see this issue: The calendar events are in UTC (https://github.com/SimpleMachines/SMF2.1/issues/5842); so if your current time is corresponding to sometime "yesterday" in UTC, that might explain why the event is off.

thanks for the reply.

I always found the whole timezone issue confusing.

I experimented today - after reading the other thread re this issue - I set my timezone to my server's location (Chicago), which is the same timezone as where I and my users are based (Central America) and lo and behold, when I posted a new test event, it worked perfectly.  Date was correct.  Yehaaaa!

But on further testing, the same issue was still occurring for my users.  So I had to this afternoon, go and change every one of their profile timezones (Forum Profile > Look and Layout) to the "Forum Default"     Now they work fine too.

Would it not be wiser, if the timezone option was removed and any new registrant was automatically set to "Forum Default" ?



Title: Re: Bug? All day calendar events shown on previous date
Post by: Kindred on October 29, 2019, 12:07:20 AM
No... that would not be wiser...

It's important to configure your server and software correctly to avoid issues. The very flexibility of the system which allows people to do things also allows some people to screw things up....  doesn't mean we should make the system less flexible
Title: Re: Bug? All day calendar events shown on previous date
Post by: m4z on October 29, 2019, 11:29:16 AM
Quote from: Northern Ireland on October 28, 2019, 08:21:06 PM
Would it not be wiser, if the timezone option was removed and any new registrant was automatically set to "Forum Default" ?

I wouldn't remove the option (a forum could be national or international by design), but provide options to the admin to...
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on October 29, 2019, 01:10:30 PM
Quote from: Kindred on October 29, 2019, 12:07:20 AM
No... that would not be wiser...

Agreed, but this is an issue mostly because all negative value timezones present all-day events with the wrong day.
A lot more people would figure out (or not bother with) an hour or two of wrong time, and would actually start looking for summer/wintertime and then timezones.

But when "4th of July" always occur on the 3rd of July in my calendar it looks plain wrong even though the timezone adjust the time with a full hour from 0 hour to 23:00 the previous day...


Coding all-day events to be stored at noon would mean all time zones would still keep the date correct.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Kindred on October 29, 2019, 02:42:21 PM
Except that you are incorrect.

I just checked, using EDT (UTC-4)
Set an event for Oct 31, all day.
In my calendar it appears as Oct 31.

Because my timezones on my server and my forum are set correctly.
https://test2.turtleshellprod.com/index.php?action=calendar;viewmonth;year=2019;month=10;day=29
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on November 11, 2019, 04:25:26 PM
Incorrect?

Sure it is correct if everything is set up correctly - I have not said otherwise.
What I said was that if my timezone (as a user or even admin) is not set correctly, it takes more time to find the error when 4th of july happen on 3rd of july, as it is not an expected behaviour for a 1 hour wrong offset.

Dag
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on November 11, 2019, 04:29:29 PM
The only valid solution is to handle all day events as a special case and don't tie them to timezone because I assure you trying to fudge it with the 'do it at midday rather than midnight' would seriously break if I tried to use this at work - given that in any given day, I'm in the UK, I talk to people in New Zealand (+12/+13), and no amount of tweaking is going to fix that an all day event needs to be handled differently.

However... events tied to hours need to be treated with timezones and no amount of arguing is going to change that fact, even for regional events, because you *have* to implement timezones for that. Especially if your event is in Arizona, US. Or Ohio. Or any of the other places where you can drive for 10 minutes and change timezone and where the time matters.
Title: Re: Bug? All day calendar events shown on previous date
Post by: PoML on November 18, 2019, 04:03:53 PM
I fully agree - the optimum solution is to have full day events treated differently.  The tweak would work in most cases though, as the max difference from a given point to a timezone any other place on the world is 13hours, with fewer and fewer users looking for events the further they are geographically from the place it happens.

The rest we fully agree on - that is just a matter of making tools for the admins to set forum and help users set timezone correctly.

Quote from: Arantor on November 11, 2019, 04:29:29 PM
The only valid solution is to handle all day events as a special case and don't tie them to timezone because I assure you trying to fudge it with the 'do it at midday rather than midnight' would seriously break if I tried to use this at work - given that in any given day, I'm in the UK, I talk to people in New Zealand (+12/+13), and no amount of tweaking is going to fix that an all day event needs to be handled differently.

However... events tied to hours need to be treated with timezones and no amount of arguing is going to change that fact, even for regional events, because you *have* to implement timezones for that. Especially if your event is in Arizona, US. Or Ohio. Or any of the other places where you can drive for 10 minutes and change timezone and where the time matters.
Title: Re: Bug? All day calendar events shown on previous date
Post by: Arantor on November 18, 2019, 04:19:24 PM
Actually it's not 13 hours. The scale fully runs from Samoa (UTC-11) to Kiritimati (UTC+14), but there's possibly a shortage of internet at both extents! But even so it's very possible to have 20 hours difference - Los Angeles, US (-8) to Auckland, NZ (+12)
Title: Re: Bug? All day calendar events shown on previous date
Post by: Kindred on November 19, 2019, 12:02:33 AM
Yup... est to Japan is 14 hrs