2017 © Pedro Peláez
 

library time-duration-type

Form type for durations

image

nfq-eta/time-duration-type

Form type for durations

  • Friday, February 9, 2018
  • by Tadcka
  • Repository
  • 4 Watchers
  • 1 Stars
  • 580 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 62 % Grown

The README.md

Form type for time durations Build Status

Allows to input durations in format hh:mm or hh:mm:ss, (*1)

Options

store_as

Model data format, (*2)

Valid values are - seconds(Nfq\Bundle\TimeBundle\Form\Type\TimeDurationType::STORE_SECONDS) - minutes(Nfq\Bundle\TimeBundle\Form\Type\TimeDurationType::STORE_MINUTES)(default), (*3)

display_seconds

boolean for displaying seconds parts. Must be true for when storing as seconds. Defaults to false, (*4)

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,
                ]
            );
    }

The Versions

09/02 2018

dev-master

9999999-dev

Form type for durations

  Sources   Download

MIT

The Requires

 

The Development Requires

09/02 2018

v0.1.1

0.1.1.0

Form type for durations

  Sources   Download

MIT

The Requires

 

The Development Requires

09/02 2018

v0.1.0

0.1.0.0

Form type for durations

  Sources   Download

MIT

The Requires

 

The Development Requires