NOBUG. Restoring of backups performed in different TZ/DST was causing incorrect roll to happen.

Prevent any roll of dates if differences are < 24h
This commit is contained in:
stronk7
2009-10-05 16:54:00 +00:00
parent 20b4684483
commit 3982f34f2c
+7
View File
@@ -29,6 +29,13 @@
$currentcoursestartdate = $course_header->course_startdate;
$coursestartdatedateoffset = $form1->startdate - $currentcoursestartdate;
$restore->course_startdateoffset = $coursestartdatedateoffset; //change to restore
// Only apply rolling of dates if differences are bigger than one day
// that should solve current problems with daylight changes between
// backup and restore
if ($restore->course_startdateoffset < 24 * 60 * 60) {
$coursestartdatedateoffset = 0;
$restore->course_startdateoffset = 0;
}
} else { // don't roll if the course hasn't start date
$coursestartdatedateoffset = 0;
$restore->course_startdateoffset = 0;