Merge branch 'MDL-80692' of https://github.com/paulholden/moodle
This commit is contained in:
+9
-12
@@ -14,22 +14,14 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Contains event class for displaying the day view.
|
||||
*
|
||||
* @package core_calendar
|
||||
* @copyright 2017 Simey Lameze <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_calendar\external;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core\external\exporter;
|
||||
use core_date;
|
||||
use DateTimeImmutable;
|
||||
use renderer_base;
|
||||
use moodle_url;
|
||||
use \core_calendar\local\event\container;
|
||||
use core_calendar\local\event\container;
|
||||
|
||||
/**
|
||||
* Class for displaying the day view.
|
||||
@@ -209,7 +201,12 @@ class calendar_day_exporter extends exporter {
|
||||
|
||||
// Need to account for user's timezone.
|
||||
$usernow = usergetdate(time());
|
||||
$today = new \DateTimeImmutable();
|
||||
$today = new DateTimeImmutable(
|
||||
timezone: core_date::get_user_timezone_object(),
|
||||
);
|
||||
|
||||
// The start time should use the day's date but the current
|
||||
// time of the day (adjusted for user's timezone).
|
||||
$neweventtimestamp = $today->setTimestamp($date[0])->setTime(
|
||||
$usernow['hours'],
|
||||
$usernow['minutes'],
|
||||
|
||||
+6
-9
@@ -14,14 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Contains event class for displaying the day view.
|
||||
*
|
||||
* @package core_calendar
|
||||
* @copyright 2017 Andrew Nicols <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_calendar\external;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
@@ -29,6 +21,8 @@ defined('MOODLE_INTERNAL') || die();
|
||||
require_once($CFG->dirroot . '/calendar/lib.php');
|
||||
|
||||
use core\external\exporter;
|
||||
use core_date;
|
||||
use DateTimeImmutable;
|
||||
use renderer_base;
|
||||
use moodle_url;
|
||||
|
||||
@@ -166,7 +160,10 @@ class day_exporter extends exporter {
|
||||
$timestamp = $this->data[0];
|
||||
// Need to account for user's timezone.
|
||||
$usernow = usergetdate(time());
|
||||
$today = new \DateTimeImmutable();
|
||||
$today = new DateTimeImmutable(
|
||||
timezone: core_date::get_user_timezone_object(),
|
||||
);
|
||||
|
||||
// The start time should use the day's date but the current
|
||||
// time of the day (adjusted for user's timezone).
|
||||
$neweventstarttime = $today->setTimestamp($timestamp)->setTime(
|
||||
|
||||
Reference in New Issue
Block a user