Skip to content

Commit

Permalink
Merge pull request #969 from KhyberPass/Issue766
Browse files Browse the repository at this point in the history
Fix user time zone issue with reminder datetime. Fix for #766.
  • Loading branch information
mattlorimer committed Mar 15, 2016
2 parents d7907e8 + b827783 commit dfd1fd1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/Reminders/Reminder.php
Expand Up @@ -279,12 +279,14 @@ public static function addNotifications(jsAlerts $alert, $checkDecline = true)
return;
}

//Create separate variable to hold timedate value
$alertDateTimeNow = $timedate->nowDb();
// Create separate variable to hold timedate value
// These timedates need to be in the user time zone as the
// datetime returned by the Bean below is in the user time zone
$alertDateTimeNow = $timedate->getNow(true)->asDb(false);

// cn: get a boundary limiter
$dateTimeMax = $timedate->getNow()->modify("+{$app_list_strings['reminder_max_time']} seconds")->asDb();
$dateTimeNow = $timedate->nowDb();
$dateTimeMax = $timedate->getNow(true)->modify("+{$app_list_strings['reminder_max_time']} seconds")->asDb(false);
$dateTimeNow = $timedate->getNow(true)->asDb(false);

$dateTimeNow = $db->convert($db->quoted($dateTimeNow), 'datetime');
$dateTimeMax = $db->convert($db->quoted($dateTimeMax), 'datetime');
Expand Down Expand Up @@ -724,4 +726,4 @@ public static function getRemindersListInlineEditView(SugarBean $event)

}

?>
?>

0 comments on commit dfd1fd1

Please sign in to comment.