Skip to content

[Form] Update datetime.rst - Date label and time label are not guessed. #21147

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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

leevigraham
Copy link
Contributor

Date label and time label are not guessed.
@leevigraham leevigraham requested a review from xabbuh as a code owner June 28, 2025 01:36
@leevigraham leevigraham changed the title Update datetime.rst [Form] Update datetime.rst - Date label and time label are not guessed. Jun 28, 2025
@xabbuh
Copy link
Member

xabbuh commented Jun 28, 2025

The thing is what you linked to is only what happens inside the form type. But later on when the form is rendered the described guessing is happening inside the form theme: https://github.com/symfony/symfony/blob/62ecae9ab5225a0f3374e89ac276ebb3d22eb8f5/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig#L304-L313

@leevigraham
Copy link
Contributor Author

Hmmm… I wasn't seeing that using the div_layout theme. I'll check I wasn't overriding anything.

@leevigraham
Copy link
Contributor Author

@xabbuh I don't think the date time widget renders the form_label_content in the theme template at all. It skips the row rendering for the form.date and form.time children and renders the widget directly. Therefore no label is rendered. So I think this config option never gets applied.

Default theme, no css:

image

image

Theme html:

https://github.com/symfony/symfony/blob/62ecae9ab5225a0f3374e89ac276ebb3d22eb8f5/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig#L105-L141

image

@xabbuh
Copy link
Member

xabbuh commented Jun 30, 2025

If the option never gets applied, this rather looks like a bug to me. Can you create a small example application and open a bug report in the code repository for it?

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

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy