8000 [Form] Configure date and time field options in datetime type · Issue #8396 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Configure date and time field options in datetime type #8396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
patie opened this issue Jul 1, 2013 · 3 comments
Closed

[Form] Configure date and time field options in datetime type #8396

patie opened this issue Jul 1, 2013 · 3 comments

Comments

@patie
Copy link
Contributor
patie commented Jul 1, 2013
Q A
New feature? yes

in situation:

$builder->add('datetime', 'datetime', array(
    'date_widget' => 'single_text',
    'time_widget' => 'single_text',
    'date_format' => 'dd.MM.yyyy'
));

why its not possible to configure date and time widget separatly - like in repeated type?
for example when its required date but not time.. or other classes for each.

I suggest:

$builder->add('datetime', 'datetime', array(
    'date_widget' => [
        'widget' => 'single_text',
        'format' => 'dd.MM.yyyy',
        'required' => true            
    ],
    'time_widget' => [
        'widget' => 'single_text',
        'required' => false           
    ]
));
@michel-maier
Copy link

It's impossible to set up invalid message too...

@dewos
Copy link
dewos commented Sep 30, 2013

+1 for this. Semantic separation for Attr and all of the other options would be nice too.

@webmozart
Copy link
Contributor

Closed in favor of #9177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0