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:
commit
394ba9e94f
|
@ -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.
|
* strings of minutes, hours or days.
|
||||||
*
|
*
|
||||||
* @param integer $seconds Seconds elapsed time
|
* @param integer $seconds Seconds elapsed time
|
||||||
|
@ -488,17 +489,11 @@ function set_user_language()
|
||||||
*/
|
*/
|
||||||
function human_time_description_raw($seconds, $exactly=false, $units='large')
|
function human_time_description_raw($seconds, $exactly=false, $units='large')
|
||||||
{
|
{
|
||||||
switch ($units) {
|
if (isset($units) === false || empty($units) === true) {
|
||||||
case 'large':
|
$units = 'large';
|
||||||
$secondsString = __('seconds');
|
}
|
||||||
$daysString = __('days');
|
|
||||||
$monthsString = __('months');
|
|
||||||
$yearsString = __('years');
|
|
||||||
$minutesString = __('minutes');
|
|
||||||
$hoursString = __('hours');
|
|
||||||
$nowString = __('Now');
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
switch ($units) {
|
||||||
case 'tiny':
|
case 'tiny':
|
||||||
$secondsString = __('s');
|
$secondsString = __('s');
|
||||||
$daysString = __('d');
|
$daysString = __('d');
|
||||||
|
@ -508,6 +503,17 @@ function human_time_description_raw($seconds, $exactly=false, $units='large')
|
||||||
$hoursString = __('h');
|
$hoursString = __('h');
|
||||||
$nowString = __('N');
|
$nowString = __('N');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
case 'large':
|
||||||
|
$secondsString = __('seconds');
|
||||||
|
$daysString = __('days');
|
||||||
|
$monthsString = __('months');
|
||||||
|
$yearsString = __('years');
|
||||||
|
$minutesString = __('minutes');
|
||||||
|
$hoursString = __('hours');
|
||||||
|
$nowString = __('Now');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($seconds)) {
|
if (empty($seconds)) {
|
||||||
|
|
Loading…
Reference in New Issue