PHP Class Kimai_Format

Exibir arquivo Open project: kimai/kimai Class Usage Examples

Public Methods

Method Description
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.

Method Details

addEllipsis() public static method

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
return string

check_time_format() public static method

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
return boolean

expand_date_shortcut() public static method

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
return string

expand_time_shortcut() public static method

Allowed shortcut formats are shown in the dialogue for edit timesheet entries (click the "?").
public static expand_time_shortcut ( $time ) : string
return string

formatAnnotations() public static method

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

formatCurrency() public static method

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
return integer | array | string formatted string(s)

formatDuration() public static method

Format a duration given in seconds according to the global setting. Either seconds are shown or not.
public static formatDuration ( $sek ) : integer | array
return integer | array depending on the $sek param which contains the formatted duration

hourminsec() public static method

Returns hours, minutes and seconds as array.
public static hourminsec ( integer $sek ) : array
$sek integer number of seconds to extract the time from
return array