Fixed error functions date default type

This commit is contained in:
Daniel Barbero Martin 2020-05-22 09:39:10 +02:00
parent 289e56d8df
commit ab8916a0da
1 changed files with 17 additions and 11 deletions

View File

@ -477,7 +477,8 @@ function set_user_language()
/**
* INTERNAL (use ui_print_timestamp for output): Transform an amount of time in seconds into a human readable
* INTERNAL (use ui_print_timestamp for output):
* Transform an amount of time in seconds into a human readable
* strings of minutes, hours or days.
*
* @param integer $seconds Seconds elapsed time
@ -488,17 +489,11 @@ function set_user_language()
*/
function human_time_description_raw($seconds, $exactly=false, $units='large')
{
switch ($units) {
case 'large':
$secondsString = __('seconds');
$daysString = __('days');
$monthsString = __('months');
$yearsString = __('years');
$minutesString = __('minutes');
$hoursString = __('hours');
$nowString = __('Now');
break;
if (isset($units) === false || empty($units) === true) {
$units = 'large';
}
switch ($units) {
case 'tiny':
$secondsString = __('s');
$daysString = __('d');
@ -508,6 +503,17 @@ function human_time_description_raw($seconds, $exactly=false, $units='large')
$hoursString = __('h');
$nowString = __('N');
break;
default:
case 'large':
$secondsString = __('seconds');
$daysString = __('days');
$monthsString = __('months');
$yearsString = __('years');
$minutesString = __('minutes');
$hoursString = __('hours');
$nowString = __('Now');
break;
}
if (empty($seconds)) {