Permalink
Browse files

MDL-31425 Availability: 'Until' time calculation uses server time zon…

…e (2.1 only)

Patch by Chris Follin.
  • Loading branch information...
1 parent a1063d9 commit effd2830ba4876d806383fc09022daaff1d14a0d @sammarshallou sammarshallou committed Feb 2, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 course/modedit.php
View
@@ -305,10 +305,9 @@
$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 @@
$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;
}

0 comments on commit effd283

Please sign in to comment.