Bug 133731 - Forced date format for input of type=date
Summary: Forced date format for input of type=date
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-11 02:37 PDT by dtrunk90
Modified: 2018-12-11 17:22 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dtrunk90 2014-06-11 02:37:54 PDT
The date value interpreted from input[type=date] in the HTTP Request such as GET / POST will be formatted as yyyy-mm-dd.
Why?

It's a task of the server-side how a textfield should be interpreted.
No other browser manipulates any input data before sending to the server.

Example:
Germany - Common date format is dd.mm.yyyy
When setting up a hibernate validator model (Java) which represents the form and adding @DateTimeFormat(pattern="dd.MM.yyyy") to the field I'm facing an error as Chrome manipulates the value.
So I have the choice now: Manipulate the value on all other browsers as well and set the pattern to yyyy-MM-dd or make a workaround for Chrome to stop manipulating that value.
As the value shouldn't be manipulated I'd prefer the second one.

What's the idea behind that manipulation?
Comment 1 Jayden Seric 2018-12-11 17:22:00 PST
This is not a bug, by spec the value for input[type='date'] must conform to the ISO 8601 standard for computer-readable date and time formats, see https://html.spec.whatwg.org/multipage/forms.html#input-author-notes. The standard format allows things such as the min and max attributes and autocompletion to work.

If you want to submit arbitrary text you should use input[type='text'].

This issue can be closed.