PHP Класс Kimai_Format

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addEllipsis ( $string, $length, string $end = '...' ) : string http://www.alfasky.com/?p=20 This little function will help you truncate a string to a specified length when copying data to a place where you can only store or display a limited number of characters, then it will append “…” to it showing that some characters were removed from the original entry.
check_time_format ( string $timestring ) : boolean Check if a parset string matches with the following time-formatting: 20.08.2008-19:00:00.
expand_date_shortcut ( string $date ) : string Preprocess shortcut for date entries.
expand_time_shortcut ( $time ) : string Preprocess shortcut for time entries.
formatAnnotations ( &$ann ) Format the annotations and only include data which the user wants to see.
formatCurrency ( integer | array $number, boolean $htmlNoWrap = true ) : integer | array | string Format a currency or an array of currencies accordingly.
formatDuration ( $sek ) : integer | array Format a duration given in seconds according to the global setting. Either seconds are shown or not.
hourminsec ( integer $sek ) : array Returns hours, minutes and seconds as array.

Описание методов

addEllipsis() публичный статический метод

http://www.alfasky.com/?p=20 This little function will help you truncate a string to a specified length when copying data to a place where you can only store or display a limited number of characters, then it will append “…” to it showing that some characters were removed from the original entry.
public static addEllipsis ( $string, $length, string $end = '...' ) : string
$string
$length
$end string
Результат string

check_time_format() публичный статический метод

Check if a parset string matches with the following time-formatting: 20.08.2008-19:00:00.
public static check_time_format ( string $timestring ) : boolean
$timestring string
Результат boolean

expand_date_shortcut() публичный статический метод

Allowed shortcut formats are shown in the dialogue for edit timesheet entries (click the "?")
public static expand_date_shortcut ( string $date ) : string
$date string shortcut date
Результат string

expand_time_shortcut() публичный статический метод

Allowed shortcut formats are shown in the dialogue for edit timesheet entries (click the "?").
public static expand_time_shortcut ( $time ) : string
Результат string

formatAnnotations() публичный статический метод

The array which is passed to the method will be modified.
public static formatAnnotations ( &$ann )
$ann array the annotation array (userid => (time, costs) )

formatCurrency() публичный статический метод

Format a currency or an array of currencies accordingly.
public static formatCurrency ( integer | array $number, boolean $htmlNoWrap = true ) : integer | array | string
$number integer | array one value or an array of decimal numbers
$htmlNoWrap boolean
Результат integer | array | string formatted string(s)

formatDuration() публичный статический метод

Format a duration given in seconds according to the global setting. Either seconds are shown or not.
public static formatDuration ( $sek ) : integer | array
Результат integer | array depending on the $sek param which contains the formatted duration

hourminsec() публичный статический метод

Returns hours, minutes and seconds as array.
public static hourminsec ( integer $sek ) : array
$sek integer number of seconds to extract the time from
Результат array