diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 862cb89f019..eaad3d5c468 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -17,12 +17,6 @@ define('BLOCK_L_MAX_WIDTH', $lmax); define('BLOCK_R_MIN_WIDTH', $rmin); define('BLOCK_R_MAX_WIDTH', $rmax); - - // some defines for time periods (all are seconds) - define( 'SECONDS_ONEWEEK', 604800 ); - define( 'SECONDS_SIXDAYS', 518400 ); - define( 'SECONDS_TWOHOURS', 7200 ); - $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), BLOCK_L_MAX_WIDTH); @@ -139,10 +133,10 @@ $timenow = time(); $weekdate = $course->startdate; // this should be 0:00 Monday of that week - $weekdate += SECONDS_TWOHOURS; // Add two hours to avoid possible DST problems + $weekdate += 7200; // Add two hours to avoid possible DST problems $section = 1; $sectionmenu = array(); - $weekofseconds = SECONDS_ONEWEEK; + $weekofseconds = 604800; $course->enddate = $course->startdate + ($weekofseconds * $course->numsections); $strftimedateshort = ' '.get_string('strftimedateshort'); @@ -151,7 +145,7 @@ $nextweekdate = $weekdate + ($weekofseconds); $weekday = userdate($weekdate, $strftimedateshort); - $endweekday = userdate($weekdate+SECONDS_SIXDAYS, $strftimedateshort); + $endweekday = userdate($weekdate+518400, $strftimedateshort); if (!empty($sections[$section])) { $thissection = $sections[$section]; diff --git a/course/format/weekscss/format.php b/course/format/weekscss/format.php index 335874ca35e..3c1c4c61dee 100644 --- a/course/format/weekscss/format.php +++ b/course/format/weekscss/format.php @@ -25,11 +25,6 @@ */ //TODO (nfreear): Accessibility: evaluation, lang/en_utf8/moodle.php: $string['formatweekscss'] -// some defines for time periods (all are seconds) -define( 'SECONDS_ONEWEEK', 604800 ); -define( 'SECONDS_SIXDAYS', 518400 ); -define( 'SECONDS_TWOHOURS', 7200 ); - $week = optional_param('week', -1, PARAM_INT); if ($week != -1) { @@ -146,10 +141,10 @@ define( 'SECONDS_TWOHOURS', 7200 ); $timenow = time(); $weekdate = $course->startdate; // this should be 0:00 Monday of that week - $weekdate += SECONDS_TWOHOURS; // Add two hours to avoid possible DST problems + $weekdate += 7200; // Add two hours to avoid possible DST problems $section = 1; $sectionmenu = array(); - $weekofseconds = SECONDS_ONEWEEK; + $weekofseconds = 604800; $course->enddate = $course->startdate + ($weekofseconds * $course->numsections); $strftimedateshort = ' '.get_string('strftimedateshort'); @@ -158,7 +153,7 @@ define( 'SECONDS_TWOHOURS', 7200 ); $nextweekdate = $weekdate + ($weekofseconds); $weekday = userdate($weekdate, $strftimedateshort); - $endweekday = userdate($weekdate+SECONDS_SIXDAYS, $strftimedateshort); + $endweekday = userdate($weekdate+518400, $strftimedateshort); if (!empty($sections[$section])) { $thissection = $sections[$section];