It looks like a combination of bugs, actually:
Bug1:
At ..admin/settings/event/, 'Event timezone display' does not accept the 'sitewide time zone' option unless configurable time zones are enabled at ..admin/settings. Try as one might, the radio button will revert to 'event time zone' as the option.
Bug2:
The date fields (start and end) are off by a huge margin- in my case it is always ahead by nearly a day- as I write this, it is showing 15th August. If I enable jscalendar for picking the dates, the dates show wrongly in that calendar too.
I am convinced this is an event module bug because the scheduler module enabled for the event type shows the time perfectly on the same event node form, both when jscalendar is enabled/disabled.
I noticed that I was using an older version of the event module (5/22/06), so I downloaded the latest version, but still have the same problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | event.module_44.patch | 1.65 KB | mcurry |
| #6 | event_timezones.inc_1.patch | 1.43 KB | mcurry |
Comments
Comment #1
robbt commentedI just want to confirm the bug. When Configurable time zones is not enabled the event always reverts to Use the Events time Zone. It also set every event 1 hour earlier than the time entered by the user. When I enabled configurable time zones and edited the event settings to use the site time zone it fixed the hour discrepancy. I then disabled configurable time zones and it reverted to "use event timezones" and had the hour discrepancy again.
Comment #2
t.a. barnhart commentedi had 2 sites using 4.6; times in events were working correctly. both sites set to NONconfigurable time zones.
after upgrade to 4.7.2, event times display 1 hour early. that is, if i enter a start time of "6pm" the display is "5pm".
when i check the unix timestamp in phpMyAdmin, i find the time is also off by 1 hour: the timestamp is the same at what is being displayed and not what was entered (the start timestamp is 0000gmt, which is 5pm my time -- it should be 0100 gmt).
i remember this exact problem with an earlier version of 4.6; imagine my dismay to see it reappear in 4.7!
Comment #3
mcurry commentedThis may sound like a dumb question, but what timezone are you in? I'm using site timezone settings (rather than user or input) and am in the PST (GMT-8) zone and have exactly this problem.
Could this be related to a daylight savings time problem...? (off by 1 hour...)
Comment #4
mcurry commentedI found this DST discussion thread: http://drupal.org/node/11077
(I see that Drupal 4.7.x doesn't deal with DST issues..)
I can't see how the event start and end times are being modified (-1hour) - it's not all that clear to me how the code works... and without a real PHP debugger, it's tedious at best. I'll keep digging.
Comment #5
mcurry commentedI've done some digging: when using the jscalendar extensions (as I am), the format strings used to populate the event input forms are incorrect: they use 'm' for minute, which is really month! Should be 'i' according to this page:
http://us3.php.net/manual/en/function.date.php
So, change the incorrect formats to:
'Y-m-d H:i'And this fixes the described problems (incorrect time values in input fields) when jscalendar enabled. Doesn't do anything for the 1-hour offsets I'm seeing on my installation (also described by others, above.)
If I get a chance, I'll work up a patch file.
Comment #6
mcurry commentedThe other problem (the -1 hour error) seems to be due to an inconsistency in the way that the timezone adjustment is calculated when using 'site' timezones.
I think I've found a solution; I'd like people to review the patches and comment.
I've attached patch 1 of 2, against the Drupal-4-7 branch (Aug. 23, 2006) for event_timezones.inc to add a helper function, which is used in the forthcoming patch to event.module. Again, this is patch 1 of 2.
Comment #7
mcurry commentedPatch 2 of 2. This one is for event.module Drupal-4-7 (1.183.2.8) dated 8/23/06.
This patch is intended to correct the one-hour offset problem when events are created/edited using 'site' timezone offsets. (non-customizeable timezones, and events are set to use site timezone.)
Please review and comment.
Comment #8
mcurry commentedClarification: My patch 1 of 2 is against the drupal-4-7 label version of event_timezones.inc, with a version string of 1.4.2.3 2006/05/22 13:35:07. (Updating the comments for the original patch upload)
Comment #9
mcurry commentedIt appears that the latest 4.7.x release of the event module has the fix for the jscalendar issue I mentioned in my comment # 5, above. So, ignore that comment, please, just get the latest 4.7 distro (event.module 1.183.2.8)
Comment #10
mcurry commentedBump - anyone care to comment on the patches described at:
http://drupal.org/node/78572#comment-129620
and
http://drupal.org/node/78572#comment-129621
Mainly curious about the timezone handling problem; is this fixed/addressed elsewhere, and if so, where?
Comment #11
acinactivist,
I have the exact same issue. I applied patch 1 of 2 (http://drupal.org/node/78572#comment-129621) but this did not fix the problem. Will look into it further.
Comment #12
acThat should read 'patch 2 of 2', sorry.
Comment #13
acSorry I didn't really describe the issue properly. I am having the exact two same issues as Ramdak describes in the inital bug report. I have applied patch 2 of 2 submitted by inactivist but this did not seem to remedy the problem. Still looking :)
Comment #14
mcurry commentedIf you applied patch 2 of 2 only then you will encounter errors. Patch 2 relies on a new function introduced in patch 1 in order to work properly.
So, if you applied only patch 2, I'm puzzled if you haven't encountered any errors.
Comment #15
achmm no errors no... ill patch part 1 now.. cheers for the heads up
Comment #16
acUnfortuantly patching the other half did nothing for me either. Is your patch specific to American timezones?
Comment #17
acThese patches do not address both the issues described in the intial patch and, for me at least, they do not fix the 1 hour time difference.
Comment #18
mcurry commentedHm... well, on my system (http://amadorable.com/event) it's all working fine. I wonder why?
In any case, since it all seems to work for me, I don't know when I'll be able to investigate further... anyone else care to take a stab at it?
Changing from patch (code needs work) to active
Comment #19
mcurry commentedI forgot to mention: amadorable.com is set to GMT-7
Comment #20
acI must say it is a strange bug. I am +8 GMT and I am starting to wonder if it is a daylight saving issue. Does the event module try to apply daylight saving to timezones?
Comment #21
mcurry commentedLast time I looked at the code, I saw no DST handling. Drupal core has no notion of DST, either, from what I've read.
No, the problem I saw was due to an inconsistency in the event module's handling of timezones as described in my patches. It's possible that I've missed something, or misunderstand the way this should work, though.
Feel free to create an account on http://amadorable.com and visit http://amadorable.com/event and set up a few dummy events - it all works on my site, at least as far as I can see. Or have I missed something?
I'm perfectly willing to post my patched modules if someone wants to examine them.
-Mike
Comment #22
mcurry commentedOops, my bad, yes, the event module does use DST info from the tables in event_timezones.inc file. So, if there are any errors in the timezone information in those tables, then perhaps that could cause a problem. Perhaps the logic if failing for +8 GMT?
Also, the module behavior depends on how you have your site set up - adjustable timezones, etc. will alter the behavior of the event and basicevent module, so it's possible that the code in my patches isn't being executed on your site... how do you have timezones configured? Site-wide, user-adjustable, etc?
-Mike
Comment #23
mcurry commentedhttp://amadorable.com is set up for site-wide timezone (no user-configurable timezones.) Which may be why my patches are effective on my site, and your site did not crash when you applied patch 2 (http://drupal.org/files/issues/event.module_44.patch) only: patch 2 is executed only if site-wide timezones are set (no user-adjustable timezones.)
Is your site set to allow user-configurable timezones (Admin->Settings->Date Settings->Configurable time zones) ? My patch does not apply to that configuration, as this bug report was for site-wide timezones...
-Mike
Comment #24
acHi mike.. Thanks for the info. My site is setup in the same way as yours (sitewide timezone, no user config) which makes me even more certain it is a daylight saving issue. Here in Perth (GMT+8) we don't have daylight saving at all, but I would wager other regions that fall under +8 do, so i will checkout event_timezones.inc. Thank you for your help.
Comment #25
acI am an idiot , I am an idiot, I am an idiot.... Someone had switched the timezone to GMT+9.. and they have daylight saving of -2 so thats why.. Thanks for your help mike.. That bit of info eventually led to me finding the most obvious error ever :) sorry to waste your time but thanks once again :D
Comment #26
acupon further reflection i still have this issue.. this is making a fool of me :D anyway it is most definatley a DST issue so i will get to the bottom of it
Comment #27
hyperlogos commentedI have this problem as well. Applied the patches - no joy.
I have a wholly separate problem with jscalendar, though; if I use jscalendar and pick 21:00 for the time, then the time gets set to 09:00, which (still) displays as 08:00.
So in other words, not only do I still have the one hour offset problem, but when I use jscalendar, 12 hours are subtracted from the time in the input field if the hours are greater than 12. I think the problem is maybe around line 1513 someplace...
(pardon my php tags, I just wanted indenting and pretty printing. this chunk of code is not surrounded in
<?php ?>.)That snippet begins on line 1515 in my event.module file (post-patches.) At a glance it looks like the hour is set from the form field, then "adjusted" based on the event_ampm value. If event has not been instructed to use am/pm (?) then it modifies the value. But first, it does some jscalendar-only date parsing, because if you don't have jscalendar then you don't get this data from the same kind of field(s) right? This is the first time I've ever dug into this module's internals.
I went and changed my event settings preference to specify 24 hour time, and now while I'm still off by an hour on display, it's no longer "correcting" jscalendar dates after 12pm to something 12 hours previous.
Also one might consider looking at this code:
jscalendar doesn't return seconds. Is this so that the user can enter them manually? This line could equally be the following code:
I don't know which is more efficient. I'm leaving it alone since the existing code works, but I thought it was amusing.
Anyway my biggest problem with jscalendar is this 12 hour thing. One last recap for clarity: If I have event set to display 24 hour times, then any event time I put in with jscalendar that is past 12 pm is decremented by 12 hours, and saved this way. Not just displayed, but saved. But I'm still having the problem with the 1 hour display offset of events.
My system is currently set to PDT. My site is currently also set to PDT (-0700). This is the selection under date settings that shows the correct time. This is great, but now I'm going to have to change this setting manually? I know this is a drupal and not an event.module problem, but it seems kind of stupid to me when my system is sitting around figuring out DST for me. Obviously drupal (or php, or whoever) is somehow figuring out the proper time etc.
At this point I'm just confusing myself so I'm going to stop, but suffice to say that I am still having this off-by-one-hour problem, that I've gone and tweaked all the configuration options I can think of, and at this point I'm well and rightly lost. The sad part is that the time is saved correctly in the node, so this indicates to me that event.module is making some kind of "correction" to the time that is totally unnecessary. Perhaps both drupal's core and event.module are making an adjustment?
Comment #28
killes@www.drop.org commentedeverybody who has this problem shoudl make sure to run the latest code. there was a problem in an event module version from about May.
Comment #29
mcurry commentedI'm 'un-assigning' myself from this bug, and http://drupal.org/node/78572#comment-146693 indicates that this is no longer a problem.
Comment #30
mcurry commentedThis is all working just peachy for me, but I found that I had to make the change described here:
http://exodusdev.com/event-module-jscalendar-configuration
http://drupal.org/node/65125#comment-106269
in order to get JScalendar and event.module to play well together. In other words, as of today, using event.module + jscalendar together requires using 12h notation in event module config. If you don't, then you will have problems (I think that some of drinkypoo's observed symptoms are caused in part due to this problem.)
Anyway, I think it's safe to say that event.module and jscalendar combo still have some (minor) issues to be resolved, so I thought I'd add a pointer here to help those struggling with using events and jscalendar.
Comment #31
HorsePunchKid commentedYet another JSCalendar AM/PM 12/24-hr issue, which seems to be fixed now.