*** empty log message ***
This commit is contained in:
parent
3b2b457e3f
commit
51da1904c7
14 changed files with 309 additions and 180 deletions
|
@ -14,6 +14,7 @@ $Smarty->register_function('tra', 'S_tra');
|
|||
$Smarty->register_function('getHour', 'S_getHour');
|
||||
$Smarty->register_function('getMinute', 'S_getMinute');
|
||||
$Smarty->register_function('getSecond', 'S_getSecond');
|
||||
$Smarty->register_function('niceTime', 'S_niceTime');
|
||||
|
||||
// --- Smarty Extensions ---
|
||||
/**
|
||||
|
@ -83,6 +84,7 @@ function S_getHour($param)
|
|||
## input format is HH:MM:SS.dddddd
|
||||
extract ($param);
|
||||
list ($h, $m, $s) = explode (':', $time);
|
||||
settype($h, 'integer');
|
||||
return $h;
|
||||
}
|
||||
|
||||
|
@ -91,6 +93,7 @@ function S_getMinute($param)
|
|||
## input format is HH:MM:SS.dddddd
|
||||
extract ($param);
|
||||
list ($h, $m, $s) = explode (':', $time);
|
||||
settype($m, 'integer');
|
||||
return $m;
|
||||
}
|
||||
|
||||
|
@ -99,6 +102,29 @@ function S_getSecond($param)
|
|||
## input format is HH:MM:SS.dddddd
|
||||
extract ($param);
|
||||
list ($h, $m, $s) = explode (':', $time);
|
||||
if ($plus) $s += $plus;
|
||||
settype($s, 'integer');
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function S_niceTime($param)
|
||||
{
|
||||
extract($param);
|
||||
|
||||
if (strpos($in, '.')) list ($in, $lost) = explode('.', $in);
|
||||
$in = str_replace(' ', '', $in);
|
||||
|
||||
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($h, $i, $s) = explode(':', $in);
|
||||
elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($i, $s) = explode(':', $in);
|
||||
else $s = $in;
|
||||
|
||||
if ($all || $h > 0) $H = sprintf('%02d', $h).':';
|
||||
else $H = ' ';
|
||||
$I = sprintf('%02d', $i).':';
|
||||
$S = sprintf('%02d', $s);
|
||||
|
||||
return $H.$I.$S;
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue