Merge branch 'wip-mdl-32234' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
@@ -2095,6 +2095,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1020,10 +1020,9 @@ class moodlelib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($wday,3);
|
||||
$this->assertEquals($mon,12);
|
||||
$this->assertEquals($year,2009);
|
||||
$this->assertEquals($yday,357);
|
||||
$this->assertEquals($yday,356);
|
||||
$this->assertEquals($weekday, 'Wednesday');
|
||||
$this->assertEquals($month, 'December');
|
||||
|
||||
$arr = usergetdate($ts);//gets the timezone from the $USER object
|
||||
$arr = array_values($arr);
|
||||
|
||||
@@ -1035,10 +1034,9 @@ class moodlelib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($wday,3);
|
||||
$this->assertEquals($mon,12);
|
||||
$this->assertEquals($year,2009);
|
||||
$this->assertEquals($yday,357);
|
||||
$this->assertEquals($yday,356);
|
||||
$this->assertEquals($weekday, 'Wednesday');
|
||||
$this->assertEquals($month, 'December');
|
||||
|
||||
//set the timezone back to what it was
|
||||
$USER->timezone = $userstimezone;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user