nfq-eta / time-duration-type
Form type for durations
v0.1.1
2018-02-09 09:48 UTC
Requires
- php: ^7.1
- symfony/form: ^2.8|^3.0|^4.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2026-03-15 07:10:28 UTC
README
Allows to input durations in format hh:mm or hh:mm:ss
Options
store_as
Model data format
Valid values are
seconds(Nfq\Bundle\TimeBundle\Form\Type\TimeDurationType::STORE_SECONDS)minutes(Nfq\Bundle\TimeBundle\Form\Type\TimeDurationType::STORE_MINUTES)(default)
display_seconds
boolean for displaying seconds parts. Must be true for when storing as seconds.
Defaults to false
Minutes stored as seconds example
/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add( 'time', TimeDurationType::class, [ 'store_as' => TimeDurationType::STORE_SECONDS, 'display_seconds' => false, 'required' => false, ] ); }