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.
For example, today is November 9th, but the block was displaying events from Nov 8 under "Today" and events from Nov 9 under "Tomorrow". Fixed it by changing this line in agenda-block.tpl.php:
$today = time() - time() % (3600 * 24);
to
$today = time();
Not sure what the point of stripping this value down to a datestamp was anyway. Changing it doesn't seem to have affected anything aside from fixing this bug.
Comments
Comment #1
aidanlis CreditAttribution: aidanlis commentedThat is used to group events on the same day.
This is a duplicate of #1016336: Events are displaying in the wrong date -- a day earlier (D7), install the DateTime module and your problems (which are due to DST) will go away. See the project page for more info.
Comment #2
aidanlis CreditAttribution: aidanlis commentedComment #3
Zidewinder CreditAttribution: Zidewinder commentedYou mean the Date module? I have that installed and enabled. All my timezone settings are correct.
Seems to me this is also not a duplicate, because the other issue is about the dates themselves being off by a day, whereas in this case the dates themselves are correct, but the /wrong/ dates are being converted to "Yesterday"/"Today"/"Tomorrow".
Comment #4
jlundell CreditAttribution: jlundell commentedI too have this problem. I have Date installed and I have the timezone set the same in Agenda and Date so this does not seem to be the problem. For me, any date given for an event was correct. The problem was the "Today" and "Tomorrow" labels were wrong. Changing agenda-block.tpl.php as suggested fixed the problem for me.
Comment #5
BiigNiick CreditAttribution: BiigNiick commentedsubscribing
same problem here. all events today are showing the correct time and time zone, but are under the heading 'tomorrow'
Comment #6
aidanlis CreditAttribution: aidanlis commentedAs I said before, this is a dupe of #1016336: Events are displaying in the wrong date -- a day earlier (D7)
Follow the instructions in that issue and give me some useful debugging information ...