MyBB Community Forums

Full Version: [D] Calendar Bug - Ranged Events
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Might be a duplicate of this ranged events bug, but my problem was slightly different (and I'm unable to test the file posted in that thread, so please disregard if that fixes this issue as well).

When posting a ranged event for a single day, if you set the ending time before 7:00 PM (Eastern) it will not show up for that date on the calendar. I have tested every time from 12:01 AM - 6:59 PM (Eastern, once again) and each time it has resulted in the same problem.

Steps to Reproduce
  • Create a Ranged Event that starts and ends on the same date
  • Set the start time to any time.
  • Set the end time to any time before 7:00 PM
  • View the calendar in month, week, or daily view to see that the event is not listed.

Edit: Also, this has only been tested on my website's copy of MyBB which is fairly heavily modded. I'll be testing it tomorrow on a fresh install, as well as with the file included in the other thread, when I have the time. I'll report back if I come across anything new.
I have the same problem, version 1.41, new installation, record in db exist, but not displayed in calendar.

Single day event works ok,timezone sets to GMT+1 and 24h time-format is used, please investigate, thanks
I haven't had a chance to do any more testing, but I realized I forgot to include some info last night.

MyBB Version Number: 1.4.1
PHP Version: 4.4.9
MySQL Version: 5.0.67

Once again, I'll be testing this again later (and probably on a system with PHP 5) and I'll post again if I find any more.
After further testing, it does happen on a fresh install as well. The file included in the other thread "fixes" it but causes a different bug. Now, most of the events are being added to the next or previous date as well.

[attachment=10919]

Notice that nearly every even stretches over a course of two days now, even though they're set up with the same date but a specific time range.

First four events:
[attachment=10920]
[attachment=10921]
[attachment=10922]
[attachment=10923]

I would like to request that this be removed from the Duplicate/Fixed bugs section as it doesn't seem that this is the same problem as in the other thread (as that fix seems to have only broken it back the other way).

It has been confirmed that this bug happens on PHP 5 as well, but I have not tested the fresh install with the new file on PHP 5 (I'll do that the next time I boot my laptop).
Any chance I can get a developer to take a second look at this bug or at least move it from duplicates since its not fixed in the same way as the other bug mentioned?
I think its been fixed. Correct me if im wrong?

http://community.mybboard.net/thread-362...#pid243012
But if the fix is the same as in that thread, then it breaks it in a different way, see the second half of my second post.
After looking at it, I think I may have figured out what's happening. I appears that the actual calendar doesn't have a time zone offset of its own and it doesn't take the users into account when deciding which date to show the event on.
Confirmed, effectively what from what I can tell is happening, its adding the offset of the event's time zone without comparing it to the users time zone, so the calendar is appearing in GMT time.
I believe I found the problem, and I was completely wrong in my assumption of what was happening because I was confused about what the time zone did for an event.

Either way, the problem is in this line here.

#Line 448
$range_end = gmmktime(23, 59, 59, gmdate("n", $event['endtime']), gmdate("j", $event['endtime']), gmdate("Y", $event['endtime']));

its using the non-offset time to determine the $range_end, thus if an event ends at a time after midnight GMT it will roll it over to the next day.

#Line 448
$range_end = gmmktime(23, 59, 59, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

Replacing it with endtime_user appears to have fixed this problem.

I've attached my own fixed functions_calendar.php in case anyone wants to use it, however please note that you are doing so at your own risk and I take no liability for anything else it breaks. Also, this is in no way an official fix from one of the MyBB devs (just in case someone gets the wrong idea) so they can't be held accountable for it either.
I'm having an issue that I think falls under this bug.

Ranged event - Day 1 starts at 10:00am, Day 5 ends at 4:00pm

I have set the time zone to both CST and PST - changes nothing.

In calendar view this event expands to SEVEN days. An extra day is added both before and after the range.

MyBB: 1.4.4
PHP version: 4.4.9
MySQL: 5.0.67