mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merged removal of weeks from format_time from stable
This commit is contained in:
parent
5602f7cf2e
commit
a59e5a1c92
@ -1474,7 +1474,6 @@ $string['visibletostudents'] = 'Visible to $a';
|
||||
$string['warningdeleteresource'] = 'Warning: $a is referred in a resource. Would you like to update the resource?';
|
||||
$string['webpage'] = 'Web page';
|
||||
$string['week'] = 'Week';
|
||||
$string['weeks'] = 'weeks';
|
||||
$string['weekhide'] = 'Hide this week from $a';
|
||||
$string['weeklyoutline'] = 'Weekly outline';
|
||||
$string['weekshow'] = 'Show this week to $a';
|
||||
|
@ -911,7 +911,6 @@ function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0,
|
||||
* @uses MINSECS
|
||||
* @uses HOURSECS
|
||||
* @uses DAYSECS
|
||||
* @uses WEEKSECS
|
||||
* @uses YEARSECS
|
||||
* @param int $totalsecs ?
|
||||
* @param array $str ?
|
||||
@ -932,15 +931,11 @@ function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0,
|
||||
$str->secs = get_string('secs');
|
||||
$str->year = get_string('year');
|
||||
$str->years = get_string('years');
|
||||
$str->week = get_string('week');
|
||||
$str->weeks = get_string('weeks');
|
||||
}
|
||||
|
||||
|
||||
$years = floor($totalsecs/YEARSECS);
|
||||
$remainder = $totalsecs - ($years*YEARSECS);
|
||||
$weeks = floor($remainder/WEEKSECS);
|
||||
$remainder = $totalsecs - ($weeks*WEEKSECS);
|
||||
$days = floor($remainder/DAYSECS);
|
||||
$remainder = $totalsecs - ($days*DAYSECS);
|
||||
$hours = floor($remainder/HOURSECS);
|
||||
@ -952,25 +947,21 @@ function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0,
|
||||
$sm = ($mins == 1) ? $str->min : $str->mins;
|
||||
$sh = ($hours == 1) ? $str->hour : $str->hours;
|
||||
$sd = ($days == 1) ? $str->day : $str->days;
|
||||
$sw = ($weeks == 1) ? $str->week : $str->weeks;
|
||||
$sy = ($years == 1) ? $str->year : $str->years;
|
||||
|
||||
$oyears = '';
|
||||
$oweeks = '';
|
||||
$odays = '';
|
||||
$ohours = '';
|
||||
$omins = '';
|
||||
$osecs = '';
|
||||
|
||||
if ($years) $oyears = $years .' '. $sy;
|
||||
if ($weeks) $oweeks = $weeks .' '. $sw;
|
||||
if ($days) $odays = $days .' '. $sd;
|
||||
if ($hours) $ohours = $hours .' '. $sh;
|
||||
if ($mins) $omins = $mins .' '. $sm;
|
||||
if ($secs) $osecs = $secs .' '. $ss;
|
||||
|
||||
if ($years) return $oyears .' '. $oweeks;
|
||||
if ($weeks) return $oweeks .' '. $odays;
|
||||
if ($years) return $oyears .' '. $odays;
|
||||
if ($days) return $odays .' '. $ohours;
|
||||
if ($hours) return $ohours .' '. $omins;
|
||||
if ($mins) return $omins .' '. $osecs;
|
||||
|
@ -90,6 +90,8 @@
|
||||
|
||||
$strnever = get_string('never');
|
||||
|
||||
$datestring->year = get_string('year');
|
||||
$datestring->years = get_string('years');
|
||||
$datestring->day = get_string('day');
|
||||
$datestring->days = get_string('days');
|
||||
$datestring->hour = get_string('hour');
|
||||
|
Loading…
x
Reference in New Issue
Block a user