Merge branch 'wip-mdl-32234-m21' of git://github.com/rajeshtaneja/moodle into MOODLE_21_STABLE
This commit is contained in:
@@ -1798,6 +1798,15 @@ function usergetdate($time, $timezone=99) {
|
||||
$getdate['seconds']
|
||||
) = explode('_', $datestring);
|
||||
|
||||
// set correct datatype to match with getdate()
|
||||
$getdate['seconds'] = (int)$getdate['seconds'];
|
||||
$getdate['yday'] = (int)$getdate['yday'] - 1; // gettime returns 0 through 365
|
||||
$getdate['year'] = (int)$getdate['year'];
|
||||
$getdate['mon'] = (int)$getdate['mon'];
|
||||
$getdate['wday'] = (int)$getdate['wday'];
|
||||
$getdate['mday'] = (int)$getdate['mday'];
|
||||
$getdate['hours'] = (int)$getdate['hours'];
|
||||
$getdate['minutes'] = (int)$getdate['minutes'];
|
||||
return $getdate;
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ class moodlelib_test extends UnitTestCase {
|
||||
$this->assertEqual($wday,3);
|
||||
$this->assertEqual($mon,12);
|
||||
$this->assertEqual($year,2009);
|
||||
$this->assertEqual($yday,357);
|
||||
$this->assertEqual($yday,356);
|
||||
$this->assertEqual($weekday, 'Wednesday');
|
||||
$this->assertEqual($month, 'December');
|
||||
|
||||
@@ -595,7 +595,7 @@ class moodlelib_test extends UnitTestCase {
|
||||
$this->assertEqual($wday,3);
|
||||
$this->assertEqual($mon,12);
|
||||
$this->assertEqual($year,2009);
|
||||
$this->assertEqual($yday,357);
|
||||
$this->assertEqual($yday,356);
|
||||
$this->assertEqual($weekday, 'Wednesday');
|
||||
$this->assertEqual($month, 'December');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user