Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] DateTimeType value does not work for HTML5 datetime-local input in chrome #27233

Copy link
Copy link
Closed
@franzwilding

Description

@franzwilding
Issue body actions

Symfony version(s) affected: 4

Description
DateTimeType passes values in format yyyy-MM-dd'T'HH:mm:ssZ to the html5 input element. However chrome expects the format yyyy-MM-dd'T'HH:mm:ss for datetime-local input types.

How to reproduce

  • Create a form with a DateTimeType child, widget = 'single_text'
  • Pass data to the form
  • Render the form in chrome (v66)
  • An empty datetime input will be rendered

Possible Solution
When trying to set the format to DateTimeType::HTML5_FORMAT (yyyy-MM-dd'T'HH:mm:ss), the DateTimeType will automatically add the DateTimeToRfc3339Transformer viewTransformer which uses the format yyyy-MM-dd'T'HH:mm:ssZ.

  • One solution would be make the use of DateTimeToRfc3339Transformer optional
  • Another solution would be to get rid of the trailing Z in DateTimeToRfc3339Transformer, which would also be valid in RFC3339 I think.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.