3 ms·
One would think it should be simple in principle. User side: just show/accept whatever the site owner wants, or if it's too difficult, stick to ISO 8601 (it's
by TeMPOraL 10y ago
One would think it should be simple in principle.
User side: just show/accept whatever the site owner wants, or if it's too difficult, stick to ISO 8601 (it's the standard, damn it).
JS side: just ISO 8601.
- skrebbel 10y agoWhy ISO? JavaScript has had a Date type since forever.
- TeMPOraL 10y agoSo Date type, then, but if we're talking input fields, they're also meant to be used with forms submitted without all that JavaScript cruft on top. So if you have to convert the date input to text for sending (or direct retrieval in code), I'd say just stick to ISO. Why? Because it's a standard.
- skrebbel 10y agoAhyes, I'm so stuck in JS-o-world that I forgot there's an actual text format called HTML. Thanks :-)
- hibbelig 10y agoWhy the format the site owner wants? Why not the format the user wants?
- TeMPOraL 10y agoThat could be a reasonable default, but you need to give the programmer control over the format, or else everyone will keep using JS-powered replacements.