Bug 133731
Summary: | Forced date format for input of type=date | ||
---|---|---|---|
Product: | WebKit | Reporter: | dtrunk90 |
Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | me, m.kurz+webkitbugs |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
dtrunk90
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?
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jayden Seric
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.