From 17fdbcac4a29a404a0e66f46a334d448f0fae4bb Mon Sep 17 00:00:00 2001 From: dongsheng Date: Sun, 12 Oct 2008 05:47:35 +0000 Subject: [PATCH] "MDL-16844, making choose very old stats data possible, merged from 1.9" --- lib/statslib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/statslib.php b/lib/statslib.php index 8b09606299..42d08a2e7e 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -1318,6 +1318,13 @@ function stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$ea $timeoptions[STATS_TIME_LASTYEAR] = get_string('lastyear'); } + $years = (int)date('y', $now) - (int)date('y', $earliestmonth); + if ($years > 1) { + for($i = 2; $i <= $years; $i++) { + $timeoptions[$i*12+20] = get_string('numyears', 'moodle', $i); + } + } + return $timeoptions; } -- 2.39.5