weekly quick-entry form (#2793)

This commit is contained in:
Kevin Papst
2021-10-18 11:12:46 +02:00
committed by GitHub
parent 64893e0a95
commit 9ab098af86
105 changed files with 3356 additions and 778 deletions

View File

@@ -65,7 +65,15 @@ class DurationStringToSecondsTransformer implements DataTransformerInterface
}
try {
return $this->formatter->parseDurationString($formatToInt);
$seconds = $this->formatter->parseDurationString($formatToInt);
// DateTime throws if a duration with too many seconds is passed and an amount of so
// many seconds is likely not required in a time-tracking application ;-)
if ($seconds > 315360000000000) {
throw new TransformationFailedException('Maximum duration exceeded.');
}
return $seconds;
} catch (\Exception $e) {
throw new TransformationFailedException($e->getMessage());
}