mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
MDL-53757 core_calendar: always show whole day's events in 'day' view
This commit is contained in:
parent
4f33514063
commit
7bdc3ba6e6
1 changed files with 13 additions and 12 deletions
|
@ -53,25 +53,26 @@ $time = optional_param('time', 0, PARAM_INT);
|
||||||
|
|
||||||
$url = new moodle_url('/calendar/view.php');
|
$url = new moodle_url('/calendar/view.php');
|
||||||
|
|
||||||
if ($courseid != SITEID) {
|
|
||||||
$url->param('course', $courseid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($view !== 'upcoming') {
|
|
||||||
$url->param('view', $view);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If a day, month and year were passed then convert it to a timestamp. If these were passed
|
// If a day, month and year were passed then convert it to a timestamp. If these were passed
|
||||||
// then we can assume the day, month and year are passed as Gregorian, as no where in core
|
// then we can assume the day, month and year are passed as Gregorian, as no where in core
|
||||||
// should we be passing these values rather than the time. This is done for BC.
|
// should we be passing these values rather than the time. This is done for BC.
|
||||||
if (!empty($day) && !empty($mon) && !empty($year)) {
|
if (!empty($day) && !empty($mon) && !empty($year)) {
|
||||||
if (checkdate($mon, $day, $year)) {
|
if (checkdate($mon, $day, $year)) {
|
||||||
$time = make_timestamp($year, $mon, $day);
|
$time = make_timestamp($year, $mon, $day);
|
||||||
} else {
|
|
||||||
$time = usergetmidnight(time());
|
|
||||||
}
|
}
|
||||||
} else if (empty($time)) {
|
}
|
||||||
$time = usergetmidnight(time());
|
|
||||||
|
if (empty($time)) {
|
||||||
|
$time = time();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($courseid != SITEID) {
|
||||||
|
$url->param('course', $courseid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($view !== 'upcoming') {
|
||||||
|
$time = usergetmidnight($time);
|
||||||
|
$url->param('view', $view);
|
||||||
}
|
}
|
||||||
|
|
||||||
$url->param('time', $time);
|
$url->param('time', $time);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue