Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have google calendar feeding into agenda on a drupal 7 site. But events that should list as monday are actually listing on sunday, etc. for every day of the week. This seems to be because agenda thinks today -- Wednesday -- is thursday.
I know this is on the issue queue for aganda D6 with a lengthy thread, but I found no answers and though it would be OK to open a new issue on the subject for D7.
I am on a dedicated server running ubuntu 10.04 with php 5.3.2, perhaps it is a php version problem?
Thanks for any help and thanks for work on this cool module!
Comment | File | Size | Author |
---|---|---|---|
#101 | agenda-1016336-test_coverage_for_event_dates-94.patch | 6.67 KB | PatchRanger |
#94 | agenda-1016336-test_coverage_for_event_dates-94.patch | 6.67 KB | PatchRanger |
#85 | 1-timezonesetup.jpg | 148.87 KB | BDaggerhart |
#85 | 2-actualcalendar.jpg | 60.16 KB | BDaggerhart |
#85 | 3-erroneousdisplay.jpg | 103.26 KB | BDaggerhart |
Comments
Comment #1
a_webb CreditAttribution: a_webb commentedsorry i meant to write "for every day of the week. This seems to be because agenda thinks today -- Wednesday -- is tuesday".
Comment #2
drake.elete CreditAttribution: drake.elete commentedI am experiencing the same issue and my server is running php 5.2.13.
P.S.
I love this module--which I had noticed it earlier!
Comment #3
zaubererb88 CreditAttribution: zaubererb88 commentedsame issue here. but only "whole-day"-events are affected. all events with a definite start- and end-time work properly
ps: thanks for the good work
Comment #4
zaubererb88 CreditAttribution: zaubererb88 commentedI have a not beautiful but working workaround. Edit agenda.module and look for the following line:
After that just insert the following code and Clear your Cache in the Agenda.
What it does:
It looks for all Events without a start time and addes 2 hours (only one hour would not be enough during Summertime) to these Events. All other Events are not affected.
This works for CET for me. If you are in another timezone, you may have to change it. Just look at the Timestamp of the affected event and enter it here to see how many hours the event is to early: http://www.epochconverter.com/
This is not a fix and no long-term solution!
Comment #5
a_webb CreditAttribution: a_webb commentedThank you for your advise. The problem here seems to be that somehow agenda is displaying events from google calendar a full day off. For example a monday 2pm event is showing up in agenda as a sunday 2pm event. The thing so puzzling is that when you go to debug agenda it lists the correct date and time of the events, it just doesn't show up properly in the displayed agenda. So this is lots of problems--all my events have start times so I do not think the previous hack would help.
Thanks, and thanks module creator--hopefully this will work out for the better in the end!
Comment #6
nigelw CreditAttribution: nigelw commentedI am getting the same thing as #3. Only "All Day" event are doing this. Thoughts?
Comment #7
pixelsweatshop CreditAttribution: pixelsweatshop commentedsub
Comment #8
aidanlis CreditAttribution: aidanlis commentedThis is a timezone problem - make sure you set your sites timezone properly.
You can do this on this page: admin/config/regional/settings
It should be the same timezone as your calendar, otherwise the dates will be off. Make sure you clear your caches after setting your timezone too.
Comment #9
pixelsweatshop CreditAttribution: pixelsweatshop commentedwhen i go to that path, i get a 404. Is that the correct path?
Comment #10
aidanlis CreditAttribution: aidanlis commentedD7
Comment #11
pixelsweatshop CreditAttribution: pixelsweatshop commentedoops. I missed that this was an issue with D7. I am also getting it on D6.
Comment #12
aidanlis CreditAttribution: aidanlis commentedIf you install the Date API and set the sites timezone to the same as the calendar, does it solve it?
Comment #13
pixelsweatshop CreditAttribution: pixelsweatshop commentedDate API has been installed since the beginning. It is set to the correct timezone (also matches server and user locale settings)
Comment #14
aidanlis CreditAttribution: aidanlis commentedCould you post the following:
1) Calendar address
2) Site timezone
3) A screenshot of the events that are displayed incorrectly
Comment #15
ksdrake CreditAttribution: ksdrake commentedI'm having the same issue with the day from the google calendar being off.
In the screen shot the "today' event is correct but the events listed under Tuesday are really Wednesday events (it does display the correct end time and day.)
EST - which is the setting for both the google calendar and the date time.
Thanks!
Comment #16
aidanlis CreditAttribution: aidanlis commented@ksdrake I listed three things to post ...
Comment #17
ksdrake CreditAttribution: ksdrake commentedsorry - the url is:
http://www.google.com/calendar/embed?src=flo.office%40gmail.com&ctz=Amer...
Comment #18
kriscarp CreditAttribution: kriscarp commentedMy events are showing up fine in the block with correct dates and times, but when I click on the "View this event in Google Calendar" link, the times are off by +4 hours. I have Date module and Google time zone set the same. I'm using Central time zone. I hope to get this fixed because this is a great module!
Comment #19
theadamoliver CreditAttribution: theadamoliver commentedIn agenda.module the link shows that the events are pulled using UTC time. In agenda-block.tpl.php, format_date does not specify the timezone. This means, according to the drupal api, that format_date will use the timezone of the site. For me that is -5 UTC.
So I have a timestamp that is 3/16/2011 @ 0:00:00. (The timestamp doesn't seem to include the event time here). That is UTC, so when it is interpreted as -5 it becomes 3/15/2011 @ 19:00:00 and shows as one day earlier. If I add the argument 'UTC' to the end of the format_date call it works properly on my site. That is what I'm going to do for now, but I haven't had time to look deeper and see if it is the issue.
The way I tracked my issue was having agenda-block.tpl.php print the timestamp and then run it through a converted. Once I saw the time was 0:00:00 and not the actual start time I started looking at that timezone route.
Comment #20
JustMagicMaria CreditAttribution: JustMagicMaria commentedAdding 'UTC' to the format_date did not do it for me. I have Date API enabled and my timezone is set correctly. I'm in the Eastern/NY time zone (-5). Some of my events from yesterday are showing under my Today heading and many are off by one day (but not all).
Comment #21
aidanlis CreditAttribution: aidanlis commented#19 that's stupid.
#20 post the information in #14 so I can help.
Comment #22
ksdrake CreditAttribution: ksdrake commented1) Calendar address - https://www.google.com/calendar/embed?src=flo.office@gmail.com&ctz=Ameri...
2) Site timezone - EST Listing in drupal Regional Settings as North American/New York
3) A screenshot of the events that are displayed incorrectly - attached
Comment #23
theadamoliver CreditAttribution: theadamoliver commented#21, aidanlis, that's a very adult/friendly/useful comment (sarcasm). Perhaps instead you could have explained why a timestamp of 3/16/2011 0:00:00 goes into format_date and comes out as 3/15/2011. Fortunately the majority of the Drupal community is not like you.
Comment #24
theadamoliver CreditAttribution: theadamoliver commentedJustMagicMaria, perhaps this can help you troubleshoot. In the attached image you will see the long version of the date printed out, the actual timestamp, and then the format when UTC is specified. I am actually -4 right now, not -5, due to DST. Pop the timestamp in over at http://www.onlineconversion.com/unix_time.htm. You will see the first event is listed as 3/16/2011 @ 00:00. The format_date call in the module returns 3/15/2011 @ 20:00, the actual EDT time if the first time is interpreted as UTC. This is what I would expect according to the format_date API.
"$timezone (optional) Time zone identifier, as described at http://php.net/manual/en/timezones.php Defaults to the time zone used to display the page."
The timestamp itself is a GMT timestamp, but does not include the event time. If it included the actual time with it there probably would not be a problem. Maybe somewhere day[0][when] is not getting the proper timestamp. Attached is also a modified version of the block's php file that will give you that same output. Then you can compare the timestamp to the two different outputs.
Like I said, I have not done any further research, but it adds up for me.
Comment #25
theadamoliver CreditAttribution: theadamoliver commentedYeah, so in agenda.module at line 351, the time is stripped out of the timestamp and assigned to the key "when".
// The day the event occurs on (without time)
$event['when'] = $event['start timestamp'] - $event['start timestamp'] % (24 * 3600);
The problem is that format_date is expecting an actual timestamp, not a datestamp. Therefore timezone issues can arise. It probably should be called format_timestamp to be more descriptive. Altering line 351 to not remove the time will also probably fix the issue.
Comment #26
aidanlis CreditAttribution: aidanlis commentedI've added an explicit timezone setting for every calendar block. This finally seems to fix the issue, and I've tested it with the details in #17. The commit is [7.x-1.x 33d3de2].
If some people can test the 7.x version I'll think about backporting the fixes to 6.x
Comment #27
ksdrake CreditAttribution: ksdrake commentedSorry to report the new version does not fix the problem. I uploaded all the files, even created an new event block - same results. Must be something else.
Comment #28
JustMagicMaria CreditAttribution: JustMagicMaria commentedHere is the link to my Google calendar:
https://www.google.com/calendar/embed?src=news@fpc-stow-acton.org&ctz=Am...
My site is set to America/New York.
Sorry, I cannot provide the screenshot as I have fixed the problem on my site. I changed _agenda_parse_event as follows (around line 351 of agenda.module):
I also had to make some changes to agenda-block.tpl.php to get the Today/Yesterday/Tomorrow labels to work:
Comment #29
aidanlis CreditAttribution: aidanlis commentedksdrake: I tested it with your calendar, it works fine here ... can you screenshot your agenda configuration page and your block, and then indicate what exactly is wrong?
Comment #30
aidanlis CreditAttribution: aidanlis commentedJustMagicMaria: this bug is for version 7.x of the module.
Comment #31
JustMagicMaria CreditAttribution: JustMagicMaria commentedHi, aidanlis. I am using 7.x.
I tried version 7.x-1.2 and it does fix the problem! The only issue that is left on my site is that it shows events from yesterday even though I have "today" in my "Agenda start" configuration field for the block.
Thank you very much for this module and for your efforts.
Comment #32
Antilles128 CreditAttribution: Antilles128 commentedHey folks,
I, too, am having an issue with the dates displaying a day earlier than they occur. I've installed the Date module and that didn't seem to fix the issue.
Calendar address: sonsafaris@gmail.com
Site timezone: America/New_York
Agenda display incorrect: attached
If you need any more information, let me know.
Awesome module by the way!
-Jordan Burke
Comment #33
JustMagicMaria CreditAttribution: JustMagicMaria commentedUnfortunately, I was wrong in my last comment, the events are not actually displaying correctly. The events under Yesterday/Today/Tomorrow are correct, but once the headings switch to dates, they are off by a day. Picture attached.
Comment #34
ksdrake CreditAttribution: ksdrake commentedaidanlis: Thanks for working on this.
The problem is that the dates (aside from those for "today" and "tomorrow") that display in the agenda block are a day early. For instance - the event displaying as happening on Thursday, March 24th is actually happening on Friday March 25th.
I've attached screenshots of the config (in 3 images) and the debug log - which appears to have the dates correct.
Comment #35
myrapunzeled CreditAttribution: myrapunzeled commentedSubscribing.
I would love to see a fix.
Love this module.
Comment #36
smither CreditAttribution: smither commentedIt may be a small error in using the modulus operator. In agenda.module I found this:
// The day the event occurs on (without time)
$event['when'] = $event['start timestamp'] - $event['start timestamp'] % (24 * 3600);
I changed this to:
// The day the event occurs on (without time)
$event['when'] = (24 * 3600) + $event['start timestamp'] - $event['start timestamp'] % (24 * 3600);
which adds a day to 'when'.
After clearing the caches, this seems to work.
Can anyone see any adverse results from this change?
Many thanks for the module! We could not find any other calendar solution for our D7 site.
Comment #37
aidanlis CreditAttribution: aidanlis commentedWhat's the logic behind your change? You're adding an entire day to every event timestamp ... this "$event['start timestamp'] % (24 * 3600);" returns 0 not 24 * 3600 for a full day event.
Comment #38
aidanlis CreditAttribution: aidanlis commentedThe first thing to note is that the module works for UTC -- thus any change like #36 is going to be completely wrong. See the attached image as evidence of this.
Comment #39
smither CreditAttribution: smither commentedHi aidanlis.
Not sure I understand the comment:
"this "$event['start timestamp'] % (24 * 3600);" returns 0 not 24 * 3600 for a full day event."
Isn't $event['start timestamp'] a single point in time and not an interval?
Example: 1301469083 % (24 * 3600) would be the fractional part of a day in the timestamp in this case 0.2996 of a day or 25,883 seconds.
I agree the original logic looks correct. I wonder if there is a 1 based array (rather than 0 based) some where that is causing the issue?
After the change in agenda.module, the same sort of change needs to be made in agenda-block.tpl.php:
Change:
$today = time() - time() % (3600 * 24);
To:
$today = 86400 + time() - time() % (3600 * 24);
To get the Yesterday, Today, Tomorrow to display correct.
I'm not at all sure that this won't cause other problems, but it seems to correct the issued discussed on this page.
Comment #40
aidanlis CreditAttribution: aidanlis commented@smither, for a full day event there is no start time and thus no fraction of a day - the modulus returns 0.
As for your other suggestions, they are totally incorrect - it may work for you in a limited subset of events, but will not work for others with different timezones. Please stop confusing the issue and see #38.
Comment #41
aidanlis CreditAttribution: aidanlis commented#1111626: DateObject and DateTime have different behaviour has something to do with it ...
Comment #42
aidanlis CreditAttribution: aidanlis commentedI've just pushed a new -dev version which radically changes the way dates are handled. This introduces a dependency on PHP 5.1+. I've tested this on a UTC calendar and an America/New_York calendar and it seems to work. As always, please test the changes and let me know if it's fixed ...
Comment #43
aidanlis CreditAttribution: aidanlis commentedNote that you'll have to update your dateformat setting because I renamed a variable, the default is "l, F jS".
Comment #44
ThomPatterson CreditAttribution: ThomPatterson commentedFixed it for me! Using America/Chicago
Comment #45
JustMagicMaria CreditAttribution: JustMagicMaria commentedHi, aidanlis. I can't find a 7.x dev version. Am I missing something?
Comment #46
aidanlis CreditAttribution: aidanlis commentedJustMagicMaria, http://drupal.org/node/462536/git-instructions
Comment #47
brizone CreditAttribution: brizone commentedWould you please upload the fix so that we can all use it? thx!
Comment #48
aidanlis CreditAttribution: aidanlis commentedPlease don't change the priority, and the fix is available in git (see #46). It will be available in a -dev release when drupal.org gets around to processing it.
Comment #49
aidanlis CreditAttribution: aidanlis commentedI'm going to assume this is finally fixed. I know I've said that a dozen times, but please let it be true this time.
Comment #50
kijutsu CreditAttribution: kijutsu commentedI wish I could confirm this -- but I cannot.
If you look at the attached photo --
the SBS -- LIVE! was an event on Sunday May 15th @ 8pm EST.
That screenshot was taken on May 16th @ 8:30 am EST.
The timezone of the google calendar is EST.
And I've tried various timezones in Agenda, EST, EST5EDT, America/Detroit, America/New_York. All without success.
Looking forward to a fix -- this is a great little plugin.
Comment #51
aidanlis CreditAttribution: aidanlis commentedWhat version of Agenda are you using, and what is your calendar URL?
Comment #52
brainfreeze CreditAttribution: brainfreeze commentedI am also having an issue, the Today/Tomorrow tag on the Agenda Block are a day off. All other events in teh Calendar are correct. I am in America/New_York timezone. I am running 7.x-1.3. Please let me know any other information that you need to assist with this problem.
Thanks,
Comment #53
aidanlis CreditAttribution: aidanlis commentedWhat is your calendar URL?
Comment #54
brainfreeze CreditAttribution: brainfreeze commentedHere is one of the Calendar IDs.
As stated before All Calendar dates show correctly, however the Today Tomorrow titles are a day off.
Thanks for the help...
Comment #55
aidanlis CreditAttribution: aidanlis commented???
Comment #56
brainfreeze CreditAttribution: brainfreeze commentedI apologize, I thought this was fixed, but I was wromg. The Today and Tomorrow heading is displaying the wrong day, I dont use the yesterday heading. An event that happened today is displaying as tomorrow, actually it already happened today and is displaying as tomorrow.
Comment #57
JJmonterey CreditAttribution: JJmonterey commentedI like this module because the content can be updated from outside the website. I have also experienced the tomorrow heading displaying for a current day's event. My workaround has been to comment out the following code in agenda-block.tpl.php :
/*$dates[date('Y-m-d', $today)] = t('Today');
$dates[date('Y-m-d', $today - 86400)] = t('Yesterday');
$dates[date('Y-m-d', $today + 86400)] = t('Today');*/
The Yesterday, Today, and Tomorrow will not appear at all just the event date which is fine with me.
Comment #58
brainfreeze CreditAttribution: brainfreeze commentedThank you JJmonterey. removing the today/tomorrow headings actually would work better in my scenario. I will give it a go.
Comment #59
Hipster CreditAttribution: Hipster commentedI don't know if this is part of the same issues in Drupal 7, but I was hoping someone can help me. I finally was able to set up a calendar and my Month view seems to be working and lists all events. ( month view - http://is.gd/p18Vf9 ), however my date view gets mixed up. Wednesday days appear on Thursday. So on Aug 11, it shows events from August 10 and it all mixed up together (date view - http://is.gd/9jjuxz ).
It's really strange because month view works perfectly and they all appear on the dates they're supposed to. I was wondering if anyone had this issue and how you fixed it.
The reason I'm posting is here because it seems to be similar issue with events showing up a day before or day after and I was hoping someone can point me in the right direction. Thank you.
Comment #60
aidanlis CreditAttribution: aidanlis commented@Hipster: This issue queue is for the Agenda module, which you are not using. This module has nothing to do with the Calendar module.
Comment #61
Hipster CreditAttribution: Hipster commented@aidanlis. Thanks I was reading a thread and I thought it was related to my problem. My bet.
Comment #62
Branjawn CreditAttribution: Branjawn commentedSo, on March 31 you pushed the new dev version, and it still is not available? You said, "It will be available in a -dev release when drupal.org gets around to processing it." Any idea of when this will be?
And dont' give me the git link please. Every thing on Drupal is avail as a downloadable tarball for a reason. :)
Comment #63
aidanlis CreditAttribution: aidanlis commentedIt took you longer to write your message than it would take to download the code using git ... I don't know why there's no new -dev release.
Comment #64
Branjawn CreditAttribution: Branjawn commentedBefore writing that, I went to the git page and did not understand it. Otherwise I would have downloaded it.
Comment #65
Nyczdude CreditAttribution: Nyczdude commentedCan anyone verify that this has been resolved?
Comment #66
Balbo CreditAttribution: Balbo commentedSo, in order to resolve I just need to download, install and set Date API module, isn't it?
Comment #67
potatesalad CreditAttribution: potatesalad commentedHey! I am also trying to use America/Chicago as my timezone. Can you tell me what I need to enter in the timezone field in the Agenda module's block setting and also on my Google calendar? I would really appreciate it. Thank you!
7.x3.1 and I am having problems with events being a day behind on the agenda module, but if the new release works as confirmed in #44, then I just need to know how to setup my timezones properly cuz I'm a newb... Thank you.
Comment #68
aidanlis CreditAttribution: aidanlis commentedI think this is fixed ... please reopen if that's not the case.
Comment #70
aidanlis CreditAttribution: aidanlis commentedComment #71
aidanlis CreditAttribution: aidanlis commentedReopening because of #1336396: "Yesterday", "Today", and "Tomorrow" offset by one day from reality.
Comment #72
lpolyak CreditAttribution: lpolyak commentedI have read ALL these posts but still have a problem. Just got Agenda installed and working but it is displaying events at a time of 7 hours later than it should.
Drupal and my Google calendar are both set to the same time zone.
An event on Google calendar at 8pm June 15th is showing up in Agenda as 3am June 16th. Other events are consistently off.
Even if I change my drupal or google time zone to be different and clear drupal cache, I get the same result, 7 hours off.
Any idea what I am doing wrong?
Comment #73
aidanlis CreditAttribution: aidanlis commentedAre you using the Date module?
Comment #74
lpolyak CreditAttribution: lpolyak commentedYes, Date module is installed and enabled. Actually Date, Date API, and Date Tools are all enabled.
Comment #75
lpolyak CreditAttribution: lpolyak commentedAny other ideas for me?
Comment #76
aidanlis CreditAttribution: aidanlis commentedPrint the debug information
Comment #77
lpolyak CreditAttribution: lpolyak commentedHow do I do that?
Comment #78
escarecrow CreditAttribution: escarecrow commentedI see the same problem where events (at least full day events) for today are listed as Tomorrow in the agenda block and here's what I did to fix it.
I made the following change to agenda-block.tpl.php:
=====================
changed the line:
$today = time() - time() % (3600 * 24);
to:
$today = mktime(0, 0, 0, date('m'), date("d"), date("Y"));
=====================
Honestly, the original line looks reasonable but if I go to any of the online php tester pages,
the original line is always a day off based on the following test code
$time = time();
$tpl_timestamp_today = time() - time() % (3600 * 24);
$tpl_formatted_today = date('Y-m-d', $tpl_timestamp_today);
$tpl_formatted_tomorrow = date('Y-m-d', $tpl_timestamp_today + 86400);
echo "current unix timestamp=$time\n";
echo "\n";
echo "this is the logic in the tpl page\n";
echo " tpl_timestamp_today=$tpl_timestamp_today\n";
echo " tpl_formatted_today=$tpl_formatted_today\n";
echo " tpl_formatted_tomorrow=$tpl_formatted_tomorrow\n";
echo "\n";
$mk_timestamp_today = mktime(0, 0, 0, date('m'), date("d"), date("Y"));
$mk_formatted_today = date('Y-m-d', $mk_timestamp_today);
$mk_formatted_tomorrow = date('Y-m-d', $mk_timestamp_today + 86400);
echo "this is the same logic but the today timestamp is creeated with mktime instead\n";
echo " mk_timestamp_today=$mk_timestamp_today\n";
echo " mk_formatted_today=$mk_formatted_today\n";
echo " mk_formatted_tomorrow=$mk_formatted_tomorrow\n";
Comment #79
Geeo-1 CreditAttribution: Geeo-1 commented@escarecrow: that sounds like the timezone you are working with is incorrect. Try to prepend to your test code this: date_default_timezone_set('Your/Timezone'); where 'Your/Timezone' is your current timezone (here is a table with all the possible values: Timezones
I just started using drupal and this module but I'm wondering if you have the correct settings for the timezone in your admin pages.
Have a nice day,
Geeo
Comment #80
escarecrow CreditAttribution: escarecrow commented@Geeo:
I have a single Agenda block and it is configured to use America/Chicago.
The Drupal Regional Settings in the administration pages are also set to America/Chicago though I allow users to set their own timezones if they want in their user profiles. The logged on user, though was also set to America/Chicago.
I'm using a hosted system provider and I can't change the system timezone.
Maybe the issue is that I can't set this in the host system but I feel certain that every setting that I *can* set is set correctly.
The intention of the original line:
time() - time() % (3600 * 24);
is to strip away the time portion and leave a date value with zero'd out time values. But if the default php timezone is set to something other than UTC, then time() appears to adjust from the default epoch of Jan 1, 1970 00:00:00. So, in cases where the system's default timezone is not UTC, the epoch would appear Dec 31, 1969 19:00 or something similar. So the logic that applies the mod (time() % 3600 * 24) fails to zero out the time because it's assuming that it's starting from a base time that is already zero'd out.
I noticed the problem on July 4th (US Independence Day) when I added the Google US holidays calendar to our agenda and it showed Independence day as "Tomorrow" which was clearly incorrect.
In contrast to the original line, the line I put in:
mktime(0, 0, 0, date('m'), date("d"), date("Y"));
explicitly creates a date with zero'd out time. It is timezone insensitive. This resolved the problem I observed and consistently showed Independece Day as *Today*. I monitored it throughout the day and it successfully transitioned to *Yesterday* at midnight.
So far, the change has been reliable for me and I think I'll leave it as is for moment and continue to monitor.
Edit:
I do want to clarify that the only problem I was having was with the *Yesterday*, *Today* and *Tomorrow* labels. All of the actual dates and times were 100% correct. The change that I made only changed the labelling logic but nothing else. I tend to want to believe that if I had a timezone problem, it would have manifested itself within the actual date/time data.
Comment #81
Geeo-1 CreditAttribution: Geeo-1 commentedI do agree with you that your solution work (even if just strtotime('today') would probably be better) and what you say makes some kind of sense.
I stumbled upon this bug while evaluating the use of this module in a site I'm actually building and, after reading this whole discussion, I tried the mod myself to find out that it has no problem whatsoever. That made me worried that this bug could just appear in some strange corner case because of some weird code in the module itself but it just seems there is something incorrect somewhere else, because the function you modify works perfectly in php when you provide it the correct timezone. That's why I still think there must be some configuration problem because PHP is kind of tested and I don't expect it to fail that easily, but I could be wrong.
Comment #82
escarecrow CreditAttribution: escarecrow commentedI found another (minor) issue. As I mentioned in a previous post, all of my timezone settings are configured to use America/Chicago which is currently GMT-5. I also have the Agenda Start set to 'today' (current date with no time setting). So, I should never see anything for 'Yesterday' however I've seen that if the calendar event starts (or ends) within 5 hours of midnight (in the America/Chicago timezone), then I see those entries as Yesterday. I used the debug view of the Agenda (which is a great feature by the way) and observed that the start-min was being set to the current date (2012-08-15) and Google was returning the event from 2012-08-14 that had and end time of 20:00.
I made the following change in the agenda.module file.
In the _agenda_feed_url function, I changed
date('Y-m-d', strtotime($block->start)),
date('Y-m-d', strtotime($block->end)),
to
date('c', strtotime($block->start)),
date('c', strtotime($block->end)),
This had the effect of changing the start-min in the url to Google from 2012-08-15 to 2012-08-15T00:00:00-05:00 (and a similar change to the start-max). With this change, the Google web service returns the correct events for me.
@Geeo,
I must admit that I'm new to PHP so I'm not thoroughly familiar with the available functions. You're recommendation of strtotime('today') is clearly better and I've changed that in my environment.
Comment #83
BDaggerhart CreditAttribution: BDaggerhart commentedSubscribing
I'm using the latest version of this (7.x-1.3) and the latest version of date (7.x-2.6). I have all my time zones set up correctly, but when I put "today" or "now" in the Agenda start for a block, it always shows "Yesterday."
Comment #84
aidanlis CreditAttribution: aidanlis commentedCan you follow the debug steps outlined above?
Comment #85
BDaggerhart CreditAttribution: BDaggerhart commentedSure,
Calendar Address: f3ro1fqfj8tp3j77gsecdv5a30@group.calendar.google.com
Site Time Zone: America/New York
Pictures of: (1)Time Zone set up, (2)Actual Calendar Event page, and (3)How it's displaying in agenda
That cover everything?
Comment #86
aidanlis CreditAttribution: aidanlis commentedGreat thanks, I'll take a look now.
Comment #87
BDaggerhart CreditAttribution: BDaggerhart commentedAny thoughts on it since my last response?
Comment #88
aidanlis CreditAttribution: aidanlis commentedSorry I haven't had a chance, I'm in Mexico until the 14th, I will try and get onto it after that.
Comment #89
BDaggerhart CreditAttribution: BDaggerhart commentedNo huge rush, my site's still in production for another month or two, but I really like Agenda and its features, and would definitely like to see this fixed instead of going to something else!
Comment #90
BDaggerhart CreditAttribution: BDaggerhart commentedAnything going on with this? Still having the same issue.
Thanks
Comment #91
BDaggerhart CreditAttribution: BDaggerhart commentedSo this is still doing this, and I'm unfortunately running out of time - any chance this will be fixed, or do I need to look at another module? I prefer agenda, it's a really elegant module in its simplicity, but I do need this to work properly.
Thanks
Comment #92
lilbebel CreditAttribution: lilbebel commentedI used string overide to change the word 'Tomorrow' to 'Today'. It works. Probably not the ideal fix but avoids user confusion.
Comment #93
PatchRanger CreditAttribution: PatchRanger commented@aidanlis Please visit https://drupal.org/node/462536/edit/releases and check "Show snapshot release" near 7.x-1.3. Also please create a release for 7.x-1.x using project interface: visit https://drupal.org/node/add/project_release/462536 . It will enable packing dev-releases into tarballs for download from drupal.org - so your latest changes could be tested.
Comment #94
PatchRanger CreditAttribution: PatchRanger commentedIt looks like the issue was fixed by aidanlis' latest changes: I am using the latest 7.x-1.x - and have no trouble.
Here is the proof: test, which verifies that displaying "nicknamed days" is ok.
Please review.
@aidanlis We should switch "Version" of this issue to "7.x-1.x" once the corresponding release will be created.
Comment #95
PatchRanger CreditAttribution: PatchRanger commented@aidanlis Please enable simpletest testbot for Agenda project: see Automated Testing.
Comment #96
aidanlis CreditAttribution: aidanlis commentedI've enabled the -dev releases and added the automated testing, thanks PatchRanger.
@Ishmayl/@escarecrow can you download the latest -dev and see if it fixes your problem?
Comment #97
PatchRanger CreditAttribution: PatchRanger commented@aidanlis Great! Though I failed to find 7.x-1.x amongst created in the list of available releases . You should create a project release using project interface: visit https://drupal.org/node/add/project_release/462536 .
Comment #98
aidanlis CreditAttribution: aidanlis commentedIt's there now, might have taken a while to build: https://drupal.org/node/2070937
Comment #99
PatchRanger CreditAttribution: PatchRanger commentedWell done, now let's check whether the testbot works.
Comment #100
PatchRanger CreditAttribution: PatchRanger commentedShould start testing.
Comment #101
PatchRanger CreditAttribution: PatchRanger commentedOk, let's re-upload then. Should start testing.
Comment #102
PatchRanger CreditAttribution: PatchRanger commentedWeird, branch test for Agenda-7.x-1.x exists: https://qa.drupal.org/pifr/test/604748 - so there should be no problem with launching test.
@aidanlis Please make sure you did the following as well (quoting from Automated Testing):
It seems to me that testing only works for already committed code, which is described separately:
Comment #103
aidanlis CreditAttribution: aidanlis commentedDone! Give that another shot.
Comment #105
PatchRanger CreditAttribution: PatchRanger commentedGreat! Now all patches will be automatically tested - yay!
Actually it doesn't need work. :)
As patch from #94 got committed (see http://drupalcode.org/project/agenda.git/commit/cb5117d ) and branch, containing the test for exactly this issue, passed (see https://qa.drupal.org/pifr/test/604748 ), this issue should be considered as fixed.
In order to get rid of such bug, just check out the latest 7.x-1.x.
Feel free to re-open in case if the bug persists even with the latest 7.x-1.x (don't forget to flush all caches - just to make sure that you're not getting the old behavior).