added configurable formats for duration (#287)

This commit is contained in:
Kevin Papst
2018-09-01 17:54:17 +02:00
committed by GitHub
parent 55b7e192aa
commit ebe007eb78
10 changed files with 78 additions and 32 deletions

View File

@@ -67,7 +67,7 @@ class DurationType extends AbstractType
$builder->addModelTransformer(new CallbackTransformer(
function ($intToFormat) use ($formatter) {
try {
return $formatter->format($intToFormat, true);
return $formatter->format($intToFormat);
} catch (\Exception $e) {
throw new TransformationFailedException($e->getMessage());
}