PHP Class Kimai_Rounding

Afficher le fichier Open project: kimai/kimai Class Usage Examples

Méthodes publiques

Méthode Description
roundTimespan ( integer $start, integer $end, integer $steps, $allowRoundDown ) : array Find a beginning and end time whose timespan is as close to the real timepsan as possible while being a multiple of $steps (in minutes).

Private Methods

Méthode Description
roundTimespanCheckIfBetter ( &$bestTime, integer $newStart, integer $newEnd, integer $realStart, integer $realEnd, $allowRoundDown ) Check if the new time values are better than the old once in the array.

Method Details

roundTimespan() public static méthode

e.g.: 16:07:31 - 17:15:16 is "rounded" to 16:00:00 - 17:15:00 with steps set to 15
public static roundTimespan ( integer $start, integer $end, integer $steps, $allowRoundDown ) : array
$start integer the beginning of the timespan
$end integer the end of the timespan
$steps integer the steps in minutes (has to divide an hour, e.g. 5 is valid while 7 is not)
$allowRoundDown
Résultat array