Skip to content

[NOT MAINTAINED] Provides a SelectType containing a selection of possible time values, from 00:00 to 23:45.

Notifications You must be signed in to change notification settings

Cethy/TimeSelect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cethyworks\TimeSelect

Provides a SelectType containing a selection of possible time values, from 00:00 to 23:45 (with a default 15 minutes step).

CircleCI

How to use

namespace ExampleBundle\Form;

use Cethyworks\TimeSelect\Form\TimeSelectType;

class ExampleType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('exampleTime', TimeSelectType::class)
            // ...
        ;
    }
    // ...
}

Options

Change the input' starting value

Overrides the choices array :

// ...
public function buildForm(FormBuilderInterface $builder, array $options)
{
    
    $builder
        ->add('exampleTime', TimeSelectType::class, [
            'choices' => TimeSelectType::generateChoices(8, 45, 5, 2),
        )
        // ...
    ;
}
// ...

In this example, the input will start at 8:45 (and end at 8:30), with a 5 minutes step and a 2 hours step.

About

[NOT MAINTAINED] Provides a SelectType containing a selection of possible time values, from 00:00 to 23:45.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages