Weekly course date BEFORE the update:
Weekly course date AFTER the update:
In the file /var/www/moodle/course/format/weeks/lib.php we have now found the following adjustment:
Code Version 4.1.5+:
-------------------------------------------------------------------------------------------------
$oneweekseconds = 604800;
// Hack alert. We add 2 hours to avoid possible DST problems. (e.g. we go into daylight
// savings and the date changes.
$startdate = $startdate + 7200;
$dates = new stdClass();
$dates->start = $startdate + ($oneweekseconds * ($sectionnum - 1));
$dates->end = $dates->start + $oneweekseconds;
-------------------------------------------------------------------------------------------------
has been replaced by in version 4.1.6+:
-------------------------------------------------------------------------------------------------
// Create a DateTime object for the start date.
$startdateobj = new DateTime("@$startdate");
// Calculate the interval for one week.
$oneweekinterval = new DateInterval('P7D');
// Calculate the interval for the specified number of sections.
for ($i = 1; $i < $sectionnum; $i++) {
$startdateobj->add($oneweekinterval);
}
// Calculate the end date.
$enddateobj = clone $startdateobj;
$enddateobj->add($oneweekinterval);
$dates = new stdClass();
$dates->start = $startdateobj->getTimestamp();
$dates->end = $enddateobj->getTimestamp();
-------------------------------------------------------------------------------------------------
If we replace this part of the code with the old code in version 4.1.6+, our problem is solved.
Does anyone know this problem and is there a solution to do it without manually updapting the code?
Many thanks in advance!