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:
Kevin Papst
2025-03-13 18:00:50 +01:00
committed by GitHub
parent 934fdeb107
commit 2a75cd6230
26 changed files with 271 additions and 36 deletions

View File

@@ -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
{