Merge branch 'MDL-52380-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE
This commit is contained in:
+1
-1
@@ -2029,7 +2029,7 @@ function get_user_preferences($name = null, $default = null, $user = null) {
|
||||
// FUNCTIONS FOR HANDLING TIME.
|
||||
|
||||
/**
|
||||
* Given date parts in user time produce a GMT timestamp.
|
||||
* Given Gregorian date parts in user time produce a GMT timestamp.
|
||||
*
|
||||
* @package core
|
||||
* @category time
|
||||
|
||||
@@ -46,7 +46,9 @@ $fromyear = optional_param('fromyear', 0, PARAM_INT); // Starting date
|
||||
$fromhour = optional_param('fromhour', 0, PARAM_INT); // Starting date
|
||||
$fromminute = optional_param('fromminute', 0, PARAM_INT); // Starting date
|
||||
if ($timefromrestrict) {
|
||||
$datefrom = make_timestamp($fromyear, $frommonth, $fromday, $fromhour, $fromminute);
|
||||
$calendartype = \core_calendar\type_factory::get_calendar_instance();
|
||||
$gregorianfrom = $calendartype->convert_to_gregorian($fromyear, $frommonth, $fromday);
|
||||
$datefrom = make_timestamp($gregorianfrom['year'], $gregorianfrom['month'], $gregorianfrom['day'], $fromhour, $fromminute);
|
||||
} else {
|
||||
$datefrom = optional_param('datefrom', 0, PARAM_INT); // Starting date
|
||||
}
|
||||
@@ -58,7 +60,9 @@ $toyear = optional_param('toyear', 0, PARAM_INT); // Ending date
|
||||
$tohour = optional_param('tohour', 0, PARAM_INT); // Ending date
|
||||
$tominute = optional_param('tominute', 0, PARAM_INT); // Ending date
|
||||
if ($timetorestrict) {
|
||||
$dateto = make_timestamp($toyear, $tomonth, $today, $tohour, $tominute);
|
||||
$calendartype = \core_calendar\type_factory::get_calendar_instance();
|
||||
$gregorianto = $calendartype->convert_to_gregorian($toyear, $tomonth, $today);
|
||||
$dateto = make_timestamp($gregorianto['year'], $gregorianto['month'], $gregorianto['day'], $tohour, $tominute);
|
||||
} else {
|
||||
$dateto = optional_param('dateto', 0, PARAM_INT); // Ending date
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user