random improvements (#5382)
* remove permission check, as own timesheets should always be visible * new methods to create datetime * allow access to user roles in javascript * support class for dropdown actions * allow to edit internal rate * support human readable duration in export via user configuration * allow to order timesheet listing by user, exported and billable field * bump codecov action
This commit is contained in:
@@ -19,12 +19,17 @@ final class Duration
|
||||
public const FORMAT_DECIMAL = 'decimal';
|
||||
public const FORMAT_DEFAULT = '%h:%m';
|
||||
|
||||
public function formatDecimal(?int $seconds): float
|
||||
{
|
||||
if ($seconds === null || $seconds === 0) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
return (float) number_format($seconds / 3600, 2, '.', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms seconds into a duration string.
|
||||
*
|
||||
* @param int|null $seconds
|
||||
* @param string $format
|
||||
* @return string|null
|
||||
*/
|
||||
public function format(?int $seconds, string $format = self::FORMAT_DEFAULT): ?string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user