Skip to content

Commit 584016d

Browse files
committed
attempt to fix upcoming events disappearing too early based on time zone
1 parent 4a4c27f commit 584016d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

framework/modules/events/controllers/eventController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ function showall() {
492492
default;
493493
// $items = null;
494494
// $dates = null;
495-
$day = expDateTime::startOfDayTimestamp(time());
495+
@date_default_timezone_set(DISPLAY_DEFAULT_TIMEZONE);
496+
$day = expDateTime::startOfDayTimestamp(time()) - date('Z'); // offset TZ for 'date' entry in DB
496497
$sort_asc = true; // For the getEventsForDates call
497498
// $moreevents = false;
498499
switch ($viewrange) {
@@ -514,7 +515,7 @@ function showall() {
514515
$begin = null;
515516
$end = $day;
516517
break;
517-
case "today": // events occuring today
518+
case "today": // events occurring today
518519
$begin = $day;
519520
$end = expDateTime::endOfDayTimestamp($day);
520521
$dates = $ed->find("all", $locsql . " AND (date >= " .$day . " AND date <= " . $end . ")");

0 commit comments

Comments
 (0)