Index: application/models/application_logs/ApplicationLog.class.php =================================================================== --- application/models/application_logs/ApplicationLog.class.php (revision 111) +++ application/models/application_logs/ApplicationLog.class.php (working copy) @@ -39,7 +39,6 @@ * @return boolean */ function isToday() { - $now = DateTimeValueLib::now(); $created_on = $this->getCreatedOn(); // getCreatedOn and similar functions can return NULL @@ -47,6 +46,16 @@ return false; } + // check the user's GMT settings + $user = CompanyWebsite::instance()->getLoggedUser(); + $adj = 0; + if (isset($user)) { + $adj = $user->getTimezone(); + } + $created_on = $created_on->advance(($adj) * 60 * 60, false); + $now = DateTimeValueLib::now(); + $now = $now->advance(($adj) * 60 * 60, false); + return $now->getDay() == $created_on->getDay() && $now->getMonth() == $created_on->getMonth() && $now->getYear() == $created_on->getYear(); @@ -63,10 +72,17 @@ if (!($created_on instanceof DateTimeValue)) { return false; } - - $day_after = $created_on->advance(24 * 60 * 60, false); + + // check the user's GMT settings + $user = CompanyWebsite::instance()->getLoggedUser(); + $adj = 0; + if (isset($user)) { + $adj = $user->getTimezone(); + } + $day_after = $created_on->advance((24+$adj) * 60 * 60, false); $now = DateTimeValueLib::now(); - + $now = $now->advance(($adj) * 60 * 60, false); + return $now->getDay() == $day_after->getDay() && $now->getMonth() == $day_after->getMonth() && $now->getYear() == $day_after->getYear();