Add rounding feature

This commit is contained in:
Constantin Graf
2025-05-06 22:37:04 +02:00
committed by Constantin Graf
parent e1185af281
commit 4b726635b2
14 changed files with 735 additions and 28 deletions

View File

@@ -153,6 +153,16 @@ class TimeEntryFactory extends Factory
});
}
public function endWithDuration(Carbon $end, int $durationInSeconds): self
{
return $this->state(function (array $attributes) use ($end, $durationInSeconds): array {
return [
'start' => $end->copy()->utc()->subSeconds($durationInSeconds),
'end' => $end->copy()->utc(),
];
});
}
public function start(Carbon $start): self
{
return $this->state(function (array $attributes) use ($start): array {