Date Formats Support
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
People
(Reporter: dron.rathore, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webcompat])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Steps to reproduce: Currently the only format that Date constructor takes is : yyyy-mm-dd and all other are just "Invalid Date" new Date("dd-mm-yyyy") new Date("yyyy-dd-mm") new Date("mm-dd-yyyy") Actual results: Above all throws "Invalid Date" error. Expected results: Well I tried the same in Chrome and they just worked! As there is no as such universal format that everyone "should" use in the WebApps they build, we should extend support of other Date formats too.
Reporter | ||
Updated•9 years ago
|
Updated•9 years ago
|
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 2•5 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•4 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 3•8 months ago
|
||
This bug is a bit dated; as of now Chrome supports the following formats:
Format | Chrome | Firefox |
---|---|---|
MM-DD-YYYY | ✔️ | ❌ |
YYYY-MM-DD | ✔️ | ✔️ |
and rejects the following (two of which are suggested in this bug):
Format | Chrome | Firefox |
---|---|---|
DD-MM-YYYY | ❌ | ❌ |
YYYY-DD-MM | ❌ | ❌ |
If these were to be allowed there would be ambiguity in cases where the day is <= 12. Neither Chrome nor Firefox allow these formats with either -
or /
as the delimiter. While these formats may be preferred in some regions, it would be impossible to have it both ways without picking a default in the case of ambiguity which would cause much confusion; I think rejecting these formats is a necessary evil.
This leaves MM-DD-YYYY which Firefox does not accept but should; for this I refer you to Bug 1275498 which is dedicated to this format.
Description
•