Merge branch 'ent-5695-Strings-en-informes-Disponibilidad-y-SLA' into 'develop'

Fixed error functions date default type

See merge request artica/pandorafms!3230
This commit is contained in:
Daniel Rodriguez 2020-06-15 08:28:27 +02:00
commit 394ba9e94f
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)) {