diff --git a/src/mibew/libs/common/datetime.php b/src/mibew/libs/common/datetime.php index 1881b08b..f5de0ca6 100644 --- a/src/mibew/libs/common/datetime.php +++ b/src/mibew/libs/common/datetime.php @@ -56,11 +56,11 @@ function get_form_date($day, $month) return 0; } -function set_form_date($utime, $prefix) -{ - global $page; - $page["form${prefix}day"] = date("d", $utime); - $page["form${prefix}month"] = date("m.y", $utime); +function set_form_date($utime, $prefix) { + return array( + "form${prefix}day" => date("d", $utime), + "form${prefix}month" => date("m.y", $utime) + ); } function date_to_text($unixtime) diff --git a/src/mibew/operator/statistics.php b/src/mibew/operator/statistics.php index 4196b673..f7759a12 100644 --- a/src/mibew/operator/statistics.php +++ b/src/mibew/operator/statistics.php @@ -76,8 +76,11 @@ if (isset($_GET['startday'])) { $end = time() + 24 * 60 * 60; } } -set_form_date($start, "start"); -set_form_date($end - 24 * 60 * 60, "end"); +$page = array_merge( + $page, + set_form_date($start, "start"), + set_form_date($end - 24 * 60 * 60, "end") +); if ($start > $end) { $errors[] = getlocal("statistics.wrong.dates");