From effd2830ba4876d806383fc09022daaff1d14a0d Mon Sep 17 00:00:00 2001 From: sam marshall Date: Thu, 2 Feb 2012 14:21:43 +0000 Subject: [PATCH] MDL-31425 Availability: 'Until' time calculation uses server time zone (2.1 only) Patch by Chris Follin. --- course/modedit.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/course/modedit.php b/course/modedit.php index e16585c819b..ce0af00cb8f 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -305,10 +305,9 @@ if ($mform->is_cancelled()) { $cm->availablefrom = $fromform->availablefrom; $cm->availableuntil = $fromform->availableuntil; // The form time is midnight, but because we want it to be - // inclusive, set it to 23:59:59 on that day. + // inclusive, add 23:59:59 to the time (86,399 seconds). if ($cm->availableuntil) { - $cm->availableuntil = strtotime('23:59:59', - $cm->availableuntil); + $cm->availableuntil += 86399; } $cm->showavailability = $fromform->showavailability; condition_info::update_cm_from_form($cm,$fromform,true); @@ -384,10 +383,9 @@ if ($mform->is_cancelled()) { $newcm->availablefrom = $fromform->availablefrom; $newcm->availableuntil = $fromform->availableuntil; // The form time is midnight, but because we want it to be - // inclusive, set it to 23:59:59 on that day. + // inclusive, add 23:59:59 to the time (86,399 seconds). if ($newcm->availableuntil) { - $newcm->availableuntil = strtotime('23:59:59', - $newcm->availableuntil); + $newcm->availableuntil += 86399; } $newcm->showavailability = $fromform->showavailability; }